From b8ac48bdf07e75f75536fa4dbb746b7d134438d1 Mon Sep 17 00:00:00 2001 From: Melek Date: Thu, 3 Aug 2023 17:55:11 -0500 Subject: [PATCH 1/7] adding darkmode --- apps/somai.me/app/navbar.tsx | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/apps/somai.me/app/navbar.tsx b/apps/somai.me/app/navbar.tsx index d672be2..952cfaa 100644 --- a/apps/somai.me/app/navbar.tsx +++ b/apps/somai.me/app/navbar.tsx @@ -1,16 +1,36 @@ "use client"; +import { useTheme } from "next-themes"; import React from "react"; +import { RxMoon, RxSun } from "react-icons/rx"; -import { Stack, Link } from "@thugga/ui"; +import { Stack, Link, Button, Box } from "@thugga/ui"; const NavBar = () => { + const { theme, setTheme } = useTheme(); + + const onToggle = () => { + // Implement dark mode + if (theme === "dark") { + setTheme("light"); + } else { + setTheme("dark"); + } + }; + return ( - - Home - Essays - Papers - About + + + Home + Essays + Papers + About + +