diff --git a/commafeed-client/src/App.tsx b/commafeed-client/src/App.tsx index ce239472..57ec7af8 100644 --- a/commafeed-client/src/App.tsx +++ b/commafeed-client/src/App.tsx @@ -38,6 +38,7 @@ function Providers(props: { children: React.ReactNode }) { return ( { + return ( + + {icon} + {label} + + ) } const iconSize = 16 +interface ColorSchemeControlItem extends SegmentedControlItem { + value: MantineColorScheme +} + +const colorSchemeData: ColorSchemeControlItem[] = [ + { + value: "light", + label: } label={Light} />, + }, + { + value: "dark", + label: } label={Dark} />, + }, + { + value: "auto", + label: } label={System} />, + }, +] + +interface ViewModeControlItem extends SegmentedControlItem { + value: ViewMode +} + const viewModeData: ViewModeControlItem[] = [ { value: "title", - label: ( - - - - Compact - - - ), + label: } label={Compact} />, }, { value: "cozy", - label: ( - - - - Cozy - - - ), + label: } label={Cozy} />, }, { value: "detailed", - label: ( - - - - Detailed - - - ), + label: } label={Detailed} />, }, { value: "expanded", - label: ( - - - - Expanded - - - ), + label: } label={Expanded} />, }, ] @@ -86,8 +96,7 @@ export function ProfileMenu(props: ProfileMenuProps) { const profile = useAppSelector(state => state.user.profile) const admin = useAppSelector(state => state.user.profile?.admin) const dispatch = useAppDispatch() - const { colorScheme, toggleColorScheme } = useMantineColorScheme() - const dark = colorScheme === "dark" + const { colorScheme, setColorScheme } = useMantineColorScheme() const logout = () => { window.location.href = "logout" @@ -128,9 +137,14 @@ export function ProfileMenu(props: ProfileMenuProps) { Theme - : } onClick={() => toggleColorScheme()}> - {dark ? Switch to light theme : Switch to dark theme} - + setColorScheme(e as MantineColorScheme)} + mb="xs" + />