Commit 600140d 1 parent 275bf36 commit 600140d Copy full SHA for 600140d
File tree 1 file changed +35
-2
lines changed
1 file changed +35
-2
lines changed Original file line number Diff line number Diff line change 1
- import { EuiCallOut , EuiPanel , EuiSpacer } from '@elastic/eui' ;
1
+ import type { EuiThemeColorMode } from '@elastic/eui' ;
2
+ import {
3
+ EuiCallOut ,
4
+ EuiForm ,
5
+ EuiFormRow ,
6
+ EuiPanel ,
7
+ EuiRadioGroup ,
8
+ EuiSpacer ,
9
+ } from '@elastic/eui' ;
2
10
import type { ReactNode } from 'react' ;
11
+ import { useTheme } from '../../../hooks/theme.jsx' ;
3
12
4
13
export const SidebarItemSettings : React . FC = ( ) : ReactNode => {
14
+ const { colorMode, setColorMode } = useTheme ( ) ;
15
+
5
16
return (
6
17
< EuiPanel >
7
18
< EuiCallOut title = "Settings" iconType = "gear" size = "s" >
8
- (todo)
19
+ Customize your Phoenix experience.
9
20
</ EuiCallOut >
10
21
11
22
< EuiSpacer size = "m" />
23
+
24
+ < EuiForm component = "form" >
25
+ < EuiFormRow label = "Appearance" >
26
+ < EuiRadioGroup
27
+ name = "theme"
28
+ idSelected = { colorMode }
29
+ options = { [
30
+ {
31
+ id : 'light' ,
32
+ label : 'Light' ,
33
+ } ,
34
+ {
35
+ id : 'dark' ,
36
+ label : 'Dark' ,
37
+ } ,
38
+ ] }
39
+ onChange = { ( themeId : string ) => {
40
+ setColorMode ?.( themeId as EuiThemeColorMode ) ;
41
+ } }
42
+ />
43
+ </ EuiFormRow >
44
+ </ EuiForm >
12
45
</ EuiPanel >
13
46
) ;
14
47
} ;
You can’t perform that action at this time.
0 commit comments