Skip to content

Commit

Permalink
chore: move actions to src
Browse files Browse the repository at this point in the history
  • Loading branch information
JohanHjelsethStorstad committed Nov 8, 2023
1 parent 89bf944 commit 95f19e1
Show file tree
Hide file tree
Showing 21 changed files with 35 additions and 37 deletions.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
6 changes: 3 additions & 3 deletions src/app/(home)/page.module.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@use "@/styles/ohma";
$omegamai: url("../../images/Omegamai.jpeg");
$frontImg: url("../../images/frontImg.jpeg");
$taktlause: url("../../images/taktlause.jpeg");
$omegamai: url("backgroundimages/Omegamai.jpeg");
$frontImg: url("backgroundimages/frontImg.jpeg");
$taktlause: url("backgroundimages/taktlause.jpeg");

.wrapper {
font-size: 40px;
Expand Down
6 changes: 3 additions & 3 deletions src/app/components/Image/Image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ export default async function Image({ alt, name, ...props } : PropTypes) {
})
try {
if (!image) throw `no image found with name: ${name}`
const imagesrc = require(`./../../../../store/images/${image?.fsLocation}`)
const imagesrc = await import(`./../../../../store/images/${image?.fsLocation}`)
return (
<NextImage alt={alt ?? image.alt} src={imagesrc} {...props} />
)
} catch (err) {
const imagesrc = require('./../../../../public/default_image.jpeg')
const imagesrc = await import('./../../../../public/default_image.jpeg')
return (
<div>
<div>Could not find image {name}</div>
<NextImage alt={'default image'} src={imagesrc} {...props} />
<NextImage alt="default image" src={imagesrc} {...props} />
</div>
)
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/ImageUploader/ImageUploader.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import create from '@/app/actions/images/create'
import create from '@/actions/images/create'

export default function ImageUploader() {
return (
Expand Down
2 changes: 2 additions & 0 deletions src/app/components/NavBar/BurgerMenu.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@
grid-template-columns: repeat(5, 1fr);
gap: 2*ohma.$gap;
padding: 3*ohma.$gap ohma.$gap ohma.$gap ohma.$gap;
grid-area: b;
width: 100%;
}
38 changes: 19 additions & 19 deletions src/app/components/NavBar/BurgerMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import BurgerItem from './BurgerItem'
import {
faBars,
Expand Down Expand Up @@ -29,23 +31,22 @@ function BurgerMenu({ isLoggedIn, applicationPeriod }:PropTypes) {
const [burgerOpen, setBurgerOpen] = useState(false)

return (
<>
<div className={styles.item}>
<button onClick={() => setBurgerOpen(!burgerOpen)}>
<FontAwesomeIcon icon={faBars} />
</button>
</div>
<div className={styles.burgerMenu}>
{burgerOpen && (
<>
<div className={styles.item}>
<button onClick={() => setBurgerOpen(!burgerOpen)}>
<FontAwesomeIcon icon={faBars} />
</button>
</div>
{burgerOpen ? (
<div className={styles.BurgerMenu}>
<BurgerItem href="/ombul" name="OmBul" icon={faNewspaper}/>
<BurgerItem href="/infopages/about" name="Om Omega" icon={faCircleInfo}/>
<BurgerItem href="/infopages/committees" name="Komitéer" icon={faBeer}/>
<BurgerItem href="/infopages/guides" name="Guider" icon={faQuestionCircle}/>
{!isLoggedIn &&
<BurgerItem href="/ombul" name="OmBul" icon={faNewspaper}/>
<BurgerItem href="/infopages/about" name="Om Omega" icon={faCircleInfo}/>
<BurgerItem href="/infopages/committees" name="Komitéer" icon={faBeer}/>
<BurgerItem href="/infopages/guides" name="Guider" icon={faQuestionCircle}/>
{!isLoggedIn &&
<BurgerItem href="/infopages/nystudent" name="Ny Student?" icon={faGraduationCap}/>
}
{isLoggedIn &&
}
{isLoggedIn &&
<>
<BurgerItem href="/money/shop" name="Omegashop" icon={faShoppingCart}/>
<BurgerItem href="/omegaquotes" name="Omegaquotes" icon={faComment}/>
Expand All @@ -59,11 +60,10 @@ function BurgerMenu({ isLoggedIn, applicationPeriod }:PropTypes) {
<BurgerItem href="/applications" name="Søknad" icon={faAddressCard}/>
}
</>
}
}
</div>
)}
</div>
</>
) : (<div></div>)}
</>
)
}

Expand Down
6 changes: 1 addition & 5 deletions src/app/components/NavBar/MobileNavBar.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
grid-template-areas:
". . . . ."
"b b b b b";
> .item {
> *:not(:last-child) {

border-left: solid .5px ohma.$white;
display: grid;
Expand All @@ -38,10 +38,6 @@
outline: inherit;
}
}
> .burgerMenu {
grid-area: b;
width: 100%;
}
overflow: hidden;
}

Expand Down
8 changes: 4 additions & 4 deletions src/app/components/NavBar/MobileNavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function MobileNavBar({ session } : PropTypes) {

return (
<nav className={styles.MobileNavBar}>
<div className={styles.item}>
<div>
{
isLoggedIn ?
<Link href="/events">
Expand All @@ -31,17 +31,17 @@ function MobileNavBar({ session } : PropTypes) {
</Link>
}
</div>
<div className={styles.item}>
<div>
<Link href="/news">
<FontAwesomeIcon icon={faNewspaper} />
</Link>
</div>
<div className={styles.item}>
<div>
<Link href="/">
<Image name="simple_logo" width={30}/>
</Link>
</div>
<div className={styles.item}>
<div>
{
isLoggedIn ?
<Link href={'/user/profile/me'}>
Expand Down
Binary file removed src/images/OV.jpeg
Binary file not shown.
Binary file removed src/images/add_to_home_screen.png
Binary file not shown.
Binary file removed src/images/kappemann.jpeg
Binary file not shown.
Binary file removed src/images/logo_simple.png
Binary file not shown.
Binary file removed src/images/logo_white.png
Binary file not shown.
Binary file removed src/images/magisk_hatt.png
Binary file not shown.
Binary file removed src/images/nordic.png
Binary file not shown.
Binary file removed src/images/ohma.jpeg
Binary file not shown.
Binary file removed src/images/omega_logo_white.png
Binary file not shown.
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"@/*": ["./src/*"],
"@/components/*": ["src/app/components/*"],
"@/styles/*": ["src/styles/*"],
"@/images/*": ["src/images/*"],
"@/actions/*": ["src/app/actions/*"],
"@/images/*": ["src/actions/images/*"],
"@/actions/*": ["src/actions/*"],
"@/prisma/*": ["src/prisma/*"]

}
Expand Down

0 comments on commit 95f19e1

Please sign in to comment.