1
- import { Drawer , useMediaQuery } from '@mui/material' ;
1
+ import { Drawer , styled , useMediaQuery } from '@mui/material' ;
2
2
import { SelectChangeEvent } from '@mui/material/Select' ;
3
3
import React from 'react' ;
4
4
import { Button } from '../base/Button' ;
@@ -9,7 +9,7 @@ import { Paper } from '../base/Paper';
9
9
import { Select } from '../base/Select' ;
10
10
import { FilterIcon } from '../icons' ;
11
11
import { useTheme } from '../theme' ;
12
- import { SLIGHT_BLUE } from '../theme/colors/colors' ;
12
+ import { darkModalGradient , lightModalGradient } from '../theme/colors/colors' ;
13
13
import PopperListener from './PopperListener' ;
14
14
import { TooltipIcon } from './TooltipIconButton' ;
15
15
@@ -28,6 +28,16 @@ export interface UniversalFilterProps {
28
28
id : string ;
29
29
}
30
30
31
+ export const FilterHeader = styled ( 'div' ) ( ( { theme } ) => ( {
32
+ background : theme . palette . mode === 'light' ? lightModalGradient . fotter : darkModalGradient . fotter ,
33
+ padding : '0.75rem 1rem' ,
34
+ margin : '-1rem -1rem 1rem -1rem' ,
35
+ display : 'flex' ,
36
+ justifyContent : 'space-between' ,
37
+ alignItems : 'center' ,
38
+ color : theme . palette . text . primary
39
+ } ) ) ;
40
+
31
41
function UniversalFilter ( {
32
42
filters,
33
43
selectedFilters,
@@ -68,19 +78,9 @@ function UniversalFilter({
68
78
69
79
const renderFilterContent = ( ) => (
70
80
< div >
71
- < div
72
- style = { {
73
- backgroundColor : SLIGHT_BLUE ,
74
- padding : '0.75rem 1rem' ,
75
- margin : '-1rem -1rem 1rem -1rem' ,
76
- display : 'flex' ,
77
- justifyContent : 'space-between' ,
78
- alignItems : 'center' ,
79
- color : theme . palette . text . primary
80
- } }
81
- >
81
+ < FilterHeader >
82
82
< h3 > Filters: </ h3 >
83
- </ div >
83
+ </ FilterHeader >
84
84
{ Object . keys ( filters ) . map ( ( filterColumn ) => {
85
85
const options = filters [ filterColumn ] . options ;
86
86
return (
0 commit comments