-
+
@@ -153,7 +137,8 @@ function Navbar() {
isIconOnly={ isMobile }
className={ 'flex lg:justify-start w-fit lg:w-full' }
aria-label={ `navbar: ${ meta.display_name }` }
- href={ meta.href }>
+ href={ meta.href }
+ >
{ meta.icon }
{ meta.display_name }
@@ -170,7 +155,7 @@ function Navbar() {
diff --git a/frontend/components/ThemeSwitcher.tsx b/frontend/components/ThemeSwitcher.tsx
index eda2c48..07f6f15 100644
--- a/frontend/components/ThemeSwitcher.tsx
+++ b/frontend/components/ThemeSwitcher.tsx
@@ -2,12 +2,34 @@
import React, { useEffect, useState } from 'react';
import { useTheme } from 'next-themes';
-import { Switch } from '@nextui-org/react';
-import { MdOutlineDarkMode, MdOutlineLightMode } from 'react-icons/md';
+import { Button, Dropdown, DropdownItem, DropdownMenu, DropdownTrigger } from '@nextui-org/react';
+import { MdOutlineDarkMode, MdOutlineDesktopWindows, MdOutlineLightMode } from 'react-icons/md';
+import { useScreenSizeTrigger } from '@/app/public/screenSizeTrigger';
+
+const switcherElements = new Map(
+ [
+ [ 'dark', {
+ 'display_name': 'Dark Mode',
+ 'icon':
+ } ],
+ [ 'light', {
+ 'display_name': 'Light Mode',
+ 'icon':
+ } ],
+ [ 'system', {
+ 'display_name': 'Follow System',
+ 'icon':
+ } ]
+ ]
+);
function ThemeSwitcher() {
const [ mounted, setMounted ] = useState(false);
- const { setTheme } = useTheme();
+ const { theme, setTheme } = useTheme();
+
+ const [ currTheme, setCurrTheme ] = useState(new Set([ theme as string ]));
+
+ const isMobile = useScreenSizeTrigger('lg');
useEffect(() => {
setMounted(true);
@@ -19,22 +41,51 @@ function ThemeSwitcher() {
return (
-
-
}
- endContent={
}
- onValueChange={ (isSelected) => {
- if (isSelected) {
- setTheme('light');
- } else {
- setTheme('dark');
- }
+
+
+
+
+
+ {
+ setCurrTheme(new Set([ anchorKey as string ]));
+ setTheme(anchorKey as string);
} }
- >
- { `Toggle Theme` }
-
+
+ >
+
}>
+ Light Mode
+
+
}
+ >
+ Dark Mode
+
+
}
+ >
+ Follow System
+
+
+
);
}