diff --git a/src/components/core/ThemeIcon.tsx b/src/components/core/ThemeIcon.tsx new file mode 100644 index 0000000..013a3bf --- /dev/null +++ b/src/components/core/ThemeIcon.tsx @@ -0,0 +1,21 @@ +import { ActionIcon, Tooltip, useMantineColorScheme } from "@mantine/core"; +import { IconLock, IconMoon, IconSun } from "@tabler/icons-react"; + +import { useColorScheme } from "@mantine/hooks"; + +export default function ThemeIcon() { + const colorScheme = useMantineColorScheme(); + const Icon = colorScheme.colorScheme === "dark" ? IconSun : IconMoon; + return ( + + + + + + ); +} diff --git a/src/components/layout/admin/navbar.tsx b/src/components/layout/admin/navbar.tsx index 36deb19..fe63cd4 100644 --- a/src/components/layout/admin/navbar.tsx +++ b/src/components/layout/admin/navbar.tsx @@ -1,12 +1,10 @@ "use client"; -import { ActionIcon, AppShellNavbar, Group, Image, Text } from "@mantine/core"; -import { adminNavLinks, toolsNavLiks } from "@/util/links"; +import { AppShellNavbar, Group, Image, Text } from "@mantine/core"; -import { IconLock } from "@tabler/icons-react"; +import ThemeIcon from "@/components/core/ThemeIcon"; import classes from "@/styles/BuildTeamNavbar.module.css"; -import useAvailableBuildTeam from "@/hooks/useAvailableBuildTeam"; -import { useSession } from "next-auth/react"; +import { adminNavLinks } from "@/util/links"; export interface AdminNavbar { currentLink: string; @@ -38,9 +36,7 @@ export default function AdminNavbar(props: AdminNavbar) { Admin - - - +
{links}
diff --git a/src/components/layout/buildTeam/navbar.tsx b/src/components/layout/buildTeam/navbar.tsx index aa4290c..7424e9b 100644 --- a/src/components/layout/buildTeam/navbar.tsx +++ b/src/components/layout/buildTeam/navbar.tsx @@ -2,6 +2,7 @@ import { ActionIcon, AppShellNavbar, Group, Image, Text } from "@mantine/core"; +import ThemeIcon from "@/components/core/ThemeIcon"; import { UserButton } from "@/components/core/UserButton"; import useAvailableBuildTeam from "@/hooks/useAvailableBuildTeam"; import classes from "@/styles/BuildTeamNavbar.module.css"; @@ -44,9 +45,7 @@ export default function BuildTeamNavbar(props: BuildTeamNavbar) { BuildTheEarth - - - +
{links}
diff --git a/src/components/layout/tools/navbar.tsx b/src/components/layout/tools/navbar.tsx index 795f8ef..9b36cfd 100644 --- a/src/components/layout/tools/navbar.tsx +++ b/src/components/layout/tools/navbar.tsx @@ -2,9 +2,10 @@ import { ActionIcon, AppShellNavbar, Group, Image, Text } from "@mantine/core"; -import { IconLock } from "@tabler/icons-react"; +import ThemeIcon from "@/components/core/ThemeIcon"; import classes from "@/styles/BuildTeamNavbar.module.css"; import { toolsNavLiks } from "@/util/links"; +import { IconLock } from "@tabler/icons-react"; export interface ToolsNavbar { currentLink: string; @@ -36,9 +37,7 @@ export default function ToolsNavbar(props: ToolsNavbar) { Tools - - - +
{links}
diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 5cf98b7..4109975 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -7,12 +7,12 @@ import "@mantine/nprogress/styles.css"; import "@mantine/spotlight/styles.css"; import "mantine-datatable/styles.layer.css"; -import type { AppProps } from "next/app"; +import SWRSetup from "@/components/core/SWRSetup"; +import { theme } from "@/util/theme"; import { MantineProvider } from "@mantine/core"; import { Notifications } from "@mantine/notifications"; -import SWRSetup from "@/components/core/SWRSetup"; import { SessionProvider } from "next-auth/react"; -import { theme } from "@/util/theme"; +import type { AppProps } from "next/app"; export default function App({ Component, @@ -20,7 +20,7 @@ export default function App({ }: AppProps) { return ( - + diff --git a/src/styles/BuildTeamNavbar.module.css b/src/styles/BuildTeamNavbar.module.css index 9ecf6ad..c72f5bf 100644 --- a/src/styles/BuildTeamNavbar.module.css +++ b/src/styles/BuildTeamNavbar.module.css @@ -38,11 +38,11 @@ &[data-active="true"] { &, &:hover { - background-color: var(--mantine-color-teal-light); - color: var(--mantine-color-teal-light-color); + background-color: var(--mantine-color-cyan-light); + color: var(--mantine-color-cyan-light-color); .navbarLinkIcon { - color: var(--mantine-color-teal-light-color); + color: var(--mantine-color-cyan-light-color); } } } diff --git a/src/util/theme.ts b/src/util/theme/index.ts similarity index 84% rename from src/util/theme.ts rename to src/util/theme/index.ts index c93491e..6ff1d6d 100644 --- a/src/util/theme.ts +++ b/src/util/theme/index.ts @@ -4,5 +4,5 @@ import { createTheme } from "@mantine/core"; * Main Mantine Theme of the Website */ export const theme = createTheme({ - primaryColor: "teal", + primaryColor: "cyan", });