@@ -29,13 +29,21 @@ const Root = styled(Box)(({ theme }) => ({
2929 opacity : 0.3 ,
3030 pointerEvents : 'none' ,
3131 } ,
32+ '&.dark' : {
33+ color : 'white' ,
34+ backgroundColor : 'rgba(0, 0 ,0, 0.2)' ,
35+ } ,
3236} ) ) ;
3337
34- const List = styled ( Box ) ( ( ) => ( {
38+ const List = styled ( Box ) ( ( { theme } ) => ( {
3539 backgroundColor : '#FFF' ,
3640 margin : '8px auto' ,
3741 borderRadius : 4 ,
3842 boxShadow : '0px 4px 4px rgba(0, 0, 0, 0.1)' ,
43+ '&.dark' : {
44+ color : 'white' ,
45+ backgroundColor : theme . color . secondary . $100 ,
46+ } ,
3947} ) ) ;
4048
4149const Item = styled ( Box , { label : 'Dropdown-item' } ) ( ( { theme } ) => ( {
@@ -58,6 +66,7 @@ const Dropdown: React.VFC<DropDownProps> = (props) => {
5866 disabled,
5967 onSelect,
6068 popperProps,
69+ mode = 'light' ,
6170 ...otherProps
6271 } = props ;
6372 const selectRef = useRef < HTMLDivElement > ( null ) ;
@@ -115,6 +124,10 @@ const Dropdown: React.VFC<DropDownProps> = (props) => {
115124 {
116125 'Dropdown--disabled' : disabled ,
117126 } ,
127+ {
128+ dark : mode === 'dark' ,
129+ light : mode === 'light' ,
130+ } ,
118131 ) }
119132 onClick = { handleOnClickSelect }
120133 { ...otherProps }
@@ -131,7 +144,13 @@ const Dropdown: React.VFC<DropDownProps> = (props) => {
131144 { ...popperProps }
132145 >
133146 < ClickAwayListener onClickAway = { handleOnClickAway } >
134- < List style = { { width : selectRef . current ?. offsetWidth ?? 'auto' } } >
147+ < List
148+ className = { classNames ( {
149+ dark : mode === 'dark' ,
150+ light : mode === 'light' ,
151+ } ) }
152+ style = { { width : selectRef . current ?. offsetWidth ?? 'auto' } }
153+ >
135154 { items }
136155 </ List >
137156 </ ClickAwayListener >
0 commit comments