diff --git a/app/page.tsx b/app/page.tsx index 7c52c0a..31cac53 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -18,13 +18,11 @@ export default function Home() { return (
-
+

- Welcome to{' '} - signIn("Credentials", { callbackUrl: '/graph' })} href="/"> - FalkorDB Browser - + Welcome to FalkorDB Browser

+
) diff --git a/app/providers.tsx b/app/providers.tsx index 4ef6807..b702f77 100644 --- a/app/providers.tsx +++ b/app/providers.tsx @@ -3,7 +3,7 @@ import Navbar from "@/components/custom/navbar"; import { ResizableHandle, ResizablePanel, ResizablePanelGroup } from "@/components/ui/resizable"; import { SessionProvider } from "next-auth/react"; -// import Navigation from "./components/navigation"; +import { ThemeProvider } from 'next-themes' type Props = { children?: React.ReactNode; @@ -12,13 +12,15 @@ type Props = { export const NextAuthProvider = ({ children }: Props) => { return ( - - - - - - {children} - + + + + + + + {children} + + ) }; \ No newline at end of file diff --git a/components/custom/navbar.tsx b/components/custom/navbar.tsx index fe5ef4c..2ed3d66 100644 --- a/components/custom/navbar.tsx +++ b/components/custom/navbar.tsx @@ -1,14 +1,43 @@ import { LogOut, Menu } from "lucide-react"; import { signOut, useSession } from "next-auth/react"; import Link from "next/link"; +import { Switch } from "../ui/switch"; +import { Label } from "../ui/label"; +import { useEffect, useState } from "react"; +import { useTheme } from "next-themes"; export default function Navbar() { const { data: session, status } = useSession() + const { theme, setTheme, systemTheme} = useTheme() + + const [mounted, setMounted] = useState(false) + + useEffect(() => { + setMounted(true) + }, []) + + function setDarkMode(val: boolean) { + if (val) { + setTheme("dark") + } + else { + setTheme("light") + } + } + + let darkmode = theme=="dark" || (theme=="system" && systemTheme=="dark") return ( -