diff --git a/apps/client/src/components/layouts/global/top-menu.tsx b/apps/client/src/components/layouts/global/top-menu.tsx index 52cabb5a..0ea3b40a 100644 --- a/apps/client/src/components/layouts/global/top-menu.tsx +++ b/apps/client/src/components/layouts/global/top-menu.tsx @@ -14,6 +14,7 @@ import APP_ROUTE from "@/lib/app-route.ts"; import useAuth from "@/features/auth/hooks/use-auth.ts"; import { CustomAvatar } from "@/components/ui/custom-avatar.tsx"; import { useTranslation } from "react-i18next"; +import { ThemeToggle } from '@/components/ui/theme-toggle'; export default function TopMenu() { const { t } = useTranslation(); @@ -28,85 +29,88 @@ export default function TopMenu() { } return ( - - - - - - - {workspace?.name} - - - - - - - {t("Workspace")} - - } - > - {t("Workspace settings")} - - - } - > - {t("Manage members")} - - - - - {t("Account")} - - - - -
- - {user.name} + <> + + + + + + + + {workspace?.name} - - {user.email} - -
-
-
- } - > - {t("My profile")} - + + + + + + {t("Workspace")} - } - > - {t("My preferences")} - + } + > + {t("Workspace settings")} + - + } + > + {t("Manage members")} + - }> - {t("Logout")} - - -
+ + + {t("Account")} + + + + +
+ + {user.name} + + + {user.email} + +
+
+
+ } + > + {t("My profile")} + + + } + > + {t("My preferences")} + + + + + }> + {t("Logout")} + + + + ); } diff --git a/apps/client/src/components/ui/theme-toggle.tsx b/apps/client/src/components/ui/theme-toggle.tsx new file mode 100644 index 00000000..f5c226a6 --- /dev/null +++ b/apps/client/src/components/ui/theme-toggle.tsx @@ -0,0 +1,23 @@ +import { ActionIcon, useComputedColorScheme, useMantineColorScheme } from '@mantine/core'; +import { IconSun, IconMoon } from '@tabler/icons-react'; + +export function ThemeToggle() { + const { setColorScheme } = useMantineColorScheme(); + const computedColorScheme = useComputedColorScheme('light', { getInitialValueInEffect: true }); + + return ( + setColorScheme(computedColorScheme === 'light' ? 'dark' : 'light')} + variant="transparent" + size="md" + color="foreground" + aria-label="Toggle color scheme" + > + {computedColorScheme === 'light' ? ( + + ) : ( + + )} + + ); +} \ No newline at end of file