Skip to content

Commit

Permalink
feat: toggle ui theme in settings
Browse files Browse the repository at this point in the history
  • Loading branch information
KatoakDR committed Sep 8, 2024
1 parent 275bf36 commit 600140d
Showing 1 changed file with 35 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,47 @@
import { EuiCallOut, EuiPanel, EuiSpacer } from '@elastic/eui';
import type { EuiThemeColorMode } from '@elastic/eui';
import {
EuiCallOut,
EuiForm,
EuiFormRow,
EuiPanel,
EuiRadioGroup,
EuiSpacer,
} from '@elastic/eui';
import type { ReactNode } from 'react';
import { useTheme } from '../../../hooks/theme.jsx';

export const SidebarItemSettings: React.FC = (): ReactNode => {
const { colorMode, setColorMode } = useTheme();

return (
<EuiPanel>
<EuiCallOut title="Settings" iconType="gear" size="s">
(todo)
Customize your Phoenix experience.
</EuiCallOut>

<EuiSpacer size="m" />

<EuiForm component="form">
<EuiFormRow label="Appearance">
<EuiRadioGroup
name="theme"
idSelected={colorMode}
options={[
{
id: 'light',
label: 'Light',
},
{
id: 'dark',
label: 'Dark',
},
]}
onChange={(themeId: string) => {
setColorMode?.(themeId as EuiThemeColorMode);
}}
/>
</EuiFormRow>
</EuiForm>
</EuiPanel>
);
};
Expand Down

0 comments on commit 600140d

Please sign in to comment.