From 5e3b37288d96277a6eacb7d6464760b63f72874a Mon Sep 17 00:00:00 2001 From: Biswa Kalyan Bhuyan Date: Wed, 28 May 2025 19:44:26 +0530 Subject: feat: improved UI and added dynamic theme toggle - improved the nav bar components - added the theme toggle button to toggle theme - fixed the button background for the nav bar - fixed the theme color issue to the ThemeToggle funtion - added more vibrant colors - fixed the theme logo render --- frontend/src/components/theme-toggle.tsx | 50 ++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 frontend/src/components/theme-toggle.tsx (limited to 'frontend/src/components/theme-toggle.tsx') diff --git a/frontend/src/components/theme-toggle.tsx b/frontend/src/components/theme-toggle.tsx new file mode 100644 index 0000000..17df44e --- /dev/null +++ b/frontend/src/components/theme-toggle.tsx @@ -0,0 +1,50 @@ +"use client" + +import * as React from "react" +import { Moon, Sun, Monitor } from "lucide-react" +import { useTheme } from "next-themes" + +import { Button } from "@/components/ui/button" +import { + DropdownMenu, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuTrigger, +} from "@/components/ui/dropdown-menu" + +export function ThemeToggle() { + const { setTheme, theme } = useTheme() + + return ( + + + + + + setTheme("light")} className="flex items-center gap-2 nav-dropdown-item"> + + Light + {theme === "light" && } + + setTheme("dark")} className="flex items-center gap-2 nav-dropdown-item"> + + Dark + {theme === "dark" && } + + setTheme("system")} className="flex items-center gap-2 nav-dropdown-item"> + + System + {theme === "system" && } + + + + ) +} \ No newline at end of file -- cgit v1.2.3-59-g8ed1b