Skip to content

Commit

Permalink
ui: updated theme selector
Browse files Browse the repository at this point in the history
  • Loading branch information
Nishchit14 committed Sep 15, 2023
1 parent 4a9ef04 commit 0de58b7
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,18 @@ const ThemeOptions = [
const FirecampThemeSelector = () => {
const { colorScheme, toggleColorScheme } = useMantineColorScheme();
const [isOpen, toggleOpen] = useState(false);
const [activeTheme, updateActiveTheme] = useState<{
name: string;
value: EFirecampThemeVariant;
}>();

useEffect(() => {
const activeThemeOption = ThemeOptions.find(
(t) => t.value === (colorScheme as EFirecampThemeVariant)
);
updateActiveTheme(activeThemeOption);
}, [colorScheme]);

const activeTheme = ThemeOptions.find(
(t) => t.value === (colorScheme as EFirecampThemeVariant)
);
if (!activeTheme) return <></>;
return (
<DropdownMenu
Expand Down

0 comments on commit 0de58b7

Please sign in to comment.