From d132b4971eb23296efc292c7af9e9abf433fe714 Mon Sep 17 00:00:00 2001 From: Sergey Elpashev Date: Wed, 5 Feb 2025 17:00:38 +0300 Subject: [PATCH] Feat: added switch theme btn to main page --- src/app/page.tsx | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index 99b2cd4..d6f6016 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,8 +1,8 @@ "use client"; -import { AppShell, Burger, Button, Group, Skeleton, useMantineColorScheme } from "@mantine/core"; +import { ActionIcon, AppShell, Burger, Flex, Group, Skeleton, useMantineColorScheme } from "@mantine/core"; import { useDisclosure } from "@mantine/hooks"; -import { LuSun } from "react-icons/lu"; +import { LuMoon, LuSun } from "react-icons/lu"; export default function Home() { const [opened, { toggle }] = useDisclosure(); @@ -14,10 +14,22 @@ export default function Home() { padding="md" > - - -
Logo
-
+ + + +
Logo
+
+ { + setColorScheme(colorScheme === "light" ? "dark" : "light"); + }} + variant="default" + size="md" + aria-label="Toggle color scheme" + > + {colorScheme === "light" ? : } + +
{Array(15) @@ -25,13 +37,6 @@ export default function Home() { .map((_, index) => ( ))} - Main