diff --git a/src/app/_components/NavBar/Menu.module.scss b/src/app/_components/NavBar/Menu.module.scss index 33b7e9cdd..79249aeac 100644 --- a/src/app/_components/NavBar/Menu.module.scss +++ b/src/app/_components/NavBar/Menu.module.scss @@ -37,7 +37,7 @@ width: 30 * ohma.$gap; text-decoration: none; padding: 2 * ohma.$gap; - @include ohma.layer(); + background: ohma.$colors-secondary; border-radius: ohma.$rounding; color: ohma.$colors-text; display: flex; diff --git a/src/app/_components/NavBar/NavBar.tsx b/src/app/_components/NavBar/NavBar.tsx index 4b5c3f1b4..565cbc1eb 100644 --- a/src/app/_components/NavBar/NavBar.tsx +++ b/src/app/_components/NavBar/NavBar.tsx @@ -41,7 +41,7 @@ export default async function NavBar({ profile, canEditSpecialCmsImage }: PropTy readSpecialCmsImageAction={readSpecialCmsImageFrontpage} updateCmsImageAction={updateSpecialCmsImageFrontpage} > - + { diff --git a/src/app/_components/UI/ThemeEnabler.tsx b/src/app/_components/UI/ThemeEnabler.tsx new file mode 100644 index 000000000..9be60e523 --- /dev/null +++ b/src/app/_components/UI/ThemeEnabler.tsx @@ -0,0 +1,15 @@ +'use client' + +import { applyTheme, themes } from '@/app/users/[username]/(user-admin)/theme/theme' +import { useEffect } from 'react' +import type { ThemeName } from '@/app/users/[username]/(user-admin)/theme/theme' + +export default function ThemeEnabler() { + useEffect(() => { + const saved = localStorage.getItem('theme') as ThemeName + if (saved && themes[saved]) { + applyTheme(saved) + } + }, []) + return null +} diff --git a/src/app/admin/BackButton.tsx b/src/app/admin/BackButton.tsx index 167a195df..28bceab5d 100644 --- a/src/app/admin/BackButton.tsx +++ b/src/app/admin/BackButton.tsx @@ -17,7 +17,7 @@ export default function BackButton({ className }: PropTypes) { const href = `/${pathname?.split('/').slice(1, -1).join('/')}` return ( - + ) diff --git a/src/app/admin/dots/DotList.tsx b/src/app/admin/dots/DotList.tsx index d29675f79..447687a85 100644 --- a/src/app/admin/dots/DotList.tsx +++ b/src/app/admin/dots/DotList.tsx @@ -51,11 +51,14 @@ export default function DotList({ onlyActive }: PropTypes) { }> - + {onlyActive ? 'Vis alle prikker' : 'Vis aktive prikker'} diff --git a/src/app/admin/groups/[id]/page.tsx b/src/app/admin/groups/[id]/page.tsx index 73a2aec21..983651829 100644 --- a/src/app/admin/groups/[id]/page.tsx +++ b/src/app/admin/groups/[id]/page.tsx @@ -71,11 +71,23 @@ export default async function GroupAdmin({ params }: PropTypes) { ) : ( ( group.groupType === 'CLASS' && - Gå til Kalsseadministrasjon + + Gå til Klasseadministrasjon + ) || ( group.groupType === 'OMEGA_MEMBERSHIP_GROUP' && - Gå til opptakssiden + + Gå til opptakssiden + ) ) } diff --git a/src/app/admin/lockers/page.tsx b/src/app/admin/lockers/page.tsx index dc45ce416..03022a4ae 100644 --- a/src/app/admin/lockers/page.tsx +++ b/src/app/admin/lockers/page.tsx @@ -5,8 +5,8 @@ export default function Locker() { return (

Skapreservasjoner

- Oppret ny skaplokasjon - Opprett nytt skap + Opprett ny skaplokasjon + Opprett nytt skap
) } diff --git a/src/app/admin/product/page.tsx b/src/app/admin/product/page.tsx index 9967fc91b..b72af908b 100644 --- a/src/app/admin/product/page.tsx +++ b/src/app/admin/product/page.tsx @@ -33,7 +33,12 @@ export default async function ProductPage() { {sortObjectsByName(products).map(product => - + {product.name} diff --git a/src/app/admin/schools/SchoolAdminList.tsx b/src/app/admin/schools/SchoolAdminList.tsx index 108ac927b..433b6f7b6 100644 --- a/src/app/admin/schools/SchoolAdminList.tsx +++ b/src/app/admin/schools/SchoolAdminList.tsx @@ -18,7 +18,9 @@ export async function SchoolAdminList({ schools }: PropTypes) { {schools.map(school => ( - + {school.id} {school.name} diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 2fb96f7a1..411df7736 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -19,6 +19,7 @@ import { unwrapActionReturn } from './redirectToErrorPage' import { frontpageAuth } from '@/services/frontpage/auth' import { ServerSession } from '@/auth/session/ServerSession' import type { Metadata } from 'next' +import ThemeEnabler from '@/UI/ThemeEnabler' config.autoAddCss = false @@ -51,6 +52,7 @@ export default async function RootLayout({ children }: PropTypes) { return ( + @@ -59,9 +61,9 @@ export default async function RootLayout({ children }: PropTypes) {
-
+
{children} -
+
diff --git a/src/app/news/page.tsx b/src/app/news/page.tsx index 080fa4e59..59efab93c 100644 --- a/src/app/news/page.tsx +++ b/src/app/news/page.tsx @@ -13,7 +13,7 @@ export default async function NewsArtilces() { - Arkivet + Arkivet { canCreateNews && ( diff --git a/src/app/users/[username]/(user-admin)/layout.tsx b/src/app/users/[username]/(user-admin)/layout.tsx index 0df1eadf9..10a6f48a2 100644 --- a/src/app/users/[username]/(user-admin)/layout.tsx +++ b/src/app/users/[username]/(user-admin)/layout.tsx @@ -6,7 +6,15 @@ import PageWrapper from '@/components/PageWrapper/PageWrapper' import { SubPageNavBar, SubPageNavBarItem } from '@/components/NavBar/SubPageNavBar/SubPageNavBar' import { flairAuth } from '@/services/flairs/auth' import { notFound } from 'next/navigation' -import { faCircleDot, faCog, faHatWizard, faKey, faPaperPlane, faUser } from '@fortawesome/free-solid-svg-icons' +import { + faCircleDot, + faCog, + faHatWizard, + faKey, + faPaperPlane, + faSwatchbook, + faUser +} from '@fortawesome/free-solid-svg-icons' import type { ReactNode } from 'react' import type { PropTypes } from '@/app/users/[username]/page' import type { Metadata } from 'next' @@ -53,6 +61,9 @@ export default async function UserAdmin({ children, params }: PropTypes & { chil {canAssignFlairs.authorized && Kapper } + + Tema + Innstillinger diff --git a/src/app/users/[username]/(user-admin)/theme/ThemeForm.tsx b/src/app/users/[username]/(user-admin)/theme/ThemeForm.tsx index 5f11011d5..60b4980eb 100644 --- a/src/app/users/[username]/(user-admin)/theme/ThemeForm.tsx +++ b/src/app/users/[username]/(user-admin)/theme/ThemeForm.tsx @@ -1,62 +1,10 @@ 'use client' import styles from './page.module.scss' - -enum ThemeName { - Standard = 'Standard', - Light = 'Light', - Solarized = 'Solarized', - StjerneInnbygger = 'StjerneInnbygger', -} - -type ThemeColors = { - primary: string; - secondary: string; - layer: string; - text: string; - textMuted: string; -}; - -const themes: Record = { - [ThemeName.Standard]: { - primary: 'hsl(210, 70%, 50%)', - secondary: 'hsl(210, 5%, 12%)', - layer: 'hsl(210, 0%, 0%, 20%)', - text: 'hsl(0, 0%, 80%)', - textMuted: 'hsl(0, 0%, 70%)', - }, - [ThemeName.Light]: { - primary: 'hsl(210, 98%, 50%)', - secondary: 'hsl(210, 18%, 95%)', - layer: 'hsl(0, 0%, 0%, 5%)', - text: 'hsl(0, 0%, 10%)', - textMuted: 'hsl(0, 0%, 20%)', - }, - [ThemeName.Solarized]: { - primary: 'hsl(210, 98%, 50%)', - secondary: 'hsl(44, 87%, 94%)', - layer: 'hsl(0, 0%, 50%, 15%)', - text: 'hsl(196, 13%, 45%)', - textMuted: 'hsl(180, 7%, 60%)', - }, - [ThemeName.StjerneInnbygger]: { - primary: 'hsl(207, 91%, 65%)', - secondary: 'hsl(202, 64%, 10%)', - layer: 'hsla(211, 48.1%, 35.5%, 0.18)', - text: 'hsl(0, 0%, 80%)', - textMuted: 'hsl(0, 0%, 70%)', - }, -} +import { themes, applyTheme } from './theme' +import type { ThemeName } from './theme' export default function ThemeForm() { - function applyTheme(name: ThemeName): void { - const colors = themes[name] - const root = document.documentElement - Object.entries(colors).forEach(([key, value]) => { - root.style.setProperty(`--${key}`, value) - }) - } - return (
{Object.entries(themes).map(([name, colors]) => ( diff --git a/src/app/users/[username]/(user-admin)/theme/theme.ts b/src/app/users/[username]/(user-admin)/theme/theme.ts new file mode 100644 index 000000000..ed9c0336b --- /dev/null +++ b/src/app/users/[username]/(user-admin)/theme/theme.ts @@ -0,0 +1,54 @@ +export enum ThemeName { + Standard = 'Standard', + Light = 'Light', + Solarized = 'Solarized', + StjerneInnbygger = 'StjerneInnbygger', +} + +type ThemeColors = { + primary: string; + secondary: string; + layer: string; + text: string; + textMuted: string; +}; + +export const themes: Record = { + [ThemeName.Standard]: { + primary: 'hsl(210, 70%, 50%)', + secondary: 'hsl(210, 5%, 12%)', + layer: 'hsla(210, 0%, 0%, 0.2)', + text: 'hsl(0, 0%, 80%)', + textMuted: 'hsl(0, 0%, 70%)', + }, + [ThemeName.Light]: { + primary: 'hsl(210, 98%, 50%)', + secondary: 'hsl(210, 18%, 95%)', + layer: 'hsla(0, 0%, 0%, 0.05)', + text: 'hsl(0, 0%, 10%)', + textMuted: 'hsl(0, 0%, 20%)', + }, + [ThemeName.Solarized]: { + primary: 'hsl(210, 98%, 50%)', + secondary: 'hsl(44, 87%, 94%)', + layer: 'hsla(0, 0%, 50%, 0.15)', + text: 'hsl(196, 13%, 45%)', + textMuted: 'hsl(180, 7%, 60%)', + }, + [ThemeName.StjerneInnbygger]: { + primary: 'hsl(207, 91%, 65%)', + secondary: 'hsl(202, 64%, 10%)', + layer: 'hsla(211, 48.1%, 35.5%, 0.18)', + text: 'hsl(0, 0%, 80%)', + textMuted: 'hsl(0, 0%, 70%)', + }, +} + +export function applyTheme(name: ThemeName): void { + localStorage.setItem('theme', name) + const colors = themes[name] + const root = document.documentElement + Object.entries(colors).forEach(([key, value]) => { + root.style.setProperty(`--${key}`, value) + }) +} diff --git a/src/prisma/seeder/standard_store/images/logo_simple.svg b/src/prisma/seeder/standard_store/images/logo_simple.svg new file mode 100644 index 000000000..517b46d3c --- /dev/null +++ b/src/prisma/seeder/standard_store/images/logo_simple.svg @@ -0,0 +1,21 @@ + + + + + + + + + diff --git a/src/prisma/seeder/standard_store/images/logo_white.svg b/src/prisma/seeder/standard_store/images/logo_white.svg new file mode 100644 index 000000000..51b0b91f1 --- /dev/null +++ b/src/prisma/seeder/standard_store/images/logo_white.svg @@ -0,0 +1,21 @@ + + + + + + + + + diff --git a/src/prisma/seeder/standard_store/images/magisk_hatt.svg b/src/prisma/seeder/standard_store/images/magisk_hatt.svg new file mode 100644 index 000000000..1d0cef255 --- /dev/null +++ b/src/prisma/seeder/standard_store/images/magisk_hatt.svg @@ -0,0 +1,21 @@ + + + + + + + + + diff --git a/src/prisma/seeder/standard_store/images/omega_logo_white.svg b/src/prisma/seeder/standard_store/images/omega_logo_white.svg new file mode 100644 index 000000000..a9bd78793 --- /dev/null +++ b/src/prisma/seeder/standard_store/images/omega_logo_white.svg @@ -0,0 +1,21 @@ + + + + + + + + + diff --git a/src/prisma/seeder/standard_store/images/pwa.svg b/src/prisma/seeder/standard_store/images/pwa.svg new file mode 100644 index 000000000..2f345f291 --- /dev/null +++ b/src/prisma/seeder/standard_store/images/pwa.svg @@ -0,0 +1,21 @@ + + + + + + + + + diff --git a/src/prisma/seeder/standard_store/images/vevcom_logo.svg b/src/prisma/seeder/standard_store/images/vevcom_logo.svg new file mode 100644 index 000000000..12d1ead42 --- /dev/null +++ b/src/prisma/seeder/standard_store/images/vevcom_logo.svg @@ -0,0 +1,21 @@ + + + + + + + + +