aboutsummaryrefslogtreecommitdiffstats
path: root/frontend/src/components/theme-toggle.tsx
diff options
context:
space:
mode:
authorLibravatarLibravatar Biswa Kalyan Bhuyan <[email protected]> 2025-05-29 20:57:31 +0530
committerLibravatarLibravatar Biswa Kalyan Bhuyan <[email protected]> 2025-05-29 20:57:31 +0530
commitca3ae0db6e8e3f2cf99423797c60f5c2cc66a780 (patch)
treef1d5fa2174283a811a5422cf148a96f435b461a6 /frontend/src/components/theme-toggle.tsx
parenta8fc4438ff1b890a78b7d2ba470011d8f87c6043 (diff)
downloadblcklst-ca3ae0db6e8e3f2cf99423797c60f5c2cc66a780.tar.gz
blcklst-ca3ae0db6e8e3f2cf99423797c60f5c2cc66a780.tar.bz2
blcklst-ca3ae0db6e8e3f2cf99423797c60f5c2cc66a780.zip
feat: added the product page and enhanced the UI
- added the product page where the product details is shown - enhanced the nav bar to handle the rendering - added the loading screen to the page - fixed the rendering method to the navigation-menu
Diffstat (limited to 'frontend/src/components/theme-toggle.tsx')
-rw-r--r--frontend/src/components/theme-toggle.tsx23
1 files changed, 2 insertions, 21 deletions
diff --git a/frontend/src/components/theme-toggle.tsx b/frontend/src/components/theme-toggle.tsx
index 7532775..09a5fb8 100644
--- a/frontend/src/components/theme-toggle.tsx
+++ b/frontend/src/components/theme-toggle.tsx
@@ -14,26 +14,6 @@ import {
export function ThemeToggle() {
const { setTheme, theme } = useTheme()
- const [mounted, setMounted] = React.useState(false)
-
- // Ensure we only render the correct icon after mounting to avoid hydration mismatch
- React.useEffect(() => {
- setMounted(true)
- }, [])
-
- if (!mounted) {
- return (
- <Button
- variant="ghost"
- size="icon"
- className="nav-button-transparent backdrop-blur-sm min-w-[44px] min-h-[44px]"
- disabled
- >
- <Monitor className="h-5 w-5" />
- <span className="sr-only">Toggle theme</span>
- </Button>
- )
- }
return (
<DropdownMenu>
@@ -41,7 +21,8 @@ export function ThemeToggle() {
<Button
variant="ghost"
size="icon"
- className="nav-button-transparent backdrop-blur-sm min-w-[44px] min-h-[44px]"
+ className="nav-button-transparent min-w-[44px] min-h-[44px] cursor-pointer"
+ suppressHydrationWarning
>
{/* Simple icon transitions with consistent styling */}
<Sun className="h-5 w-5 rotate-0 scale-100 transition-all duration-500 ease-in-out dark:-rotate-180 dark:scale-0" />