@@ -4,6 +4,7 @@ import { useCallback, useState } from 'react';
44import { Box , Drawer , Typography } from '../../base' ;
55import { CloseIcon } from '../../icons' ;
66import { darkTeal } from '../../theme' ;
7+ import { SLIGHT_BLUE } from '../../theme/colors/colors' ;
78import { CloseBtn } from '../Modal' ;
89import CatalogFilterSidebarState from './CatalogFilterSidebarState' ;
910import {
@@ -37,13 +38,15 @@ export interface CatalogFilterSidebarProps {
3738 setData : ( callback : ( prevFilters : FilterValues ) => FilterValues ) => void ;
3839 lists : FilterList [ ] ;
3940 value ?: FilterValues ;
41+ styleProps ?: StyleProps ;
4042}
4143
4244export type FilterValues = Record < string , string | string [ ] > ;
4345
4446export interface StyleProps {
4547 backgroundColor ?: string ;
4648 sectionTitleBackgroundColor ?: string ;
49+ fontFamily ?: string ;
4750}
4851
4952/**
@@ -56,7 +59,8 @@ export interface StyleProps {
5659const CatalogFilterSidebar : React . FC < CatalogFilterSidebarProps > = ( {
5760 lists,
5861 setData,
59- value = { }
62+ value = { } ,
63+ styleProps
6064} ) => {
6165 const theme = useTheme ( ) ; // Get the current theme
6266 const [ openDrawer , setOpenDrawer ] = useState < boolean > ( false ) ;
@@ -69,23 +73,29 @@ const CatalogFilterSidebar: React.FC<CatalogFilterSidebarProps> = ({
6973 setOpenDrawer ( false ) ;
7074 } , [ ] ) ;
7175
72- const styleProps : StyleProps = {
76+ const defaultStyleProps : StyleProps = {
7377 backgroundColor :
7478 theme . palette . mode === 'light'
7579 ? theme . palette . background . default
7680 : theme . palette . background . secondary ,
7781 sectionTitleBackgroundColor :
78- theme . palette . mode === 'light' ? theme . palette . background . surfaces : darkTeal . main
82+ theme . palette . mode === 'light' ? theme . palette . background . surfaces : darkTeal . main ,
83+ fontFamily : theme . typography . fontFamily
84+ } ;
85+
86+ const appliedStyleProps = {
87+ ...defaultStyleProps ,
88+ ...styleProps
7989 } ;
8090
8191 return (
8292 < >
83- < FiltersCardDiv styleProps = { styleProps } >
93+ < FiltersCardDiv styleProps = { appliedStyleProps } >
8494 < CatalogFilterSidebarState
8595 lists = { lists }
8696 onApplyFilters = { setData }
8797 value = { value }
88- styleProps = { styleProps }
98+ styleProps = { appliedStyleProps }
8999 />
90100 </ FiltersCardDiv >
91101 < FilterDrawerDiv >
@@ -103,7 +113,11 @@ const CatalogFilterSidebar: React.FC<CatalogFilterSidebarProps> = ({
103113 >
104114 < Box sx = { { overflowY : 'hidden' , height : '90vh' } } >
105115 < FiltersDrawerHeader >
106- < Typography variant = "h6" sx = { { color : theme . palette . text . default } } component = "div" >
116+ < Typography
117+ variant = "h6"
118+ sx = { { color : theme . palette . text . constant ?. white } }
119+ component = "div"
120+ >
107121 Filters
108122 </ Typography >
109123 < CloseBtn onClick = { handleDrawerClose } >
@@ -114,18 +128,17 @@ const CatalogFilterSidebar: React.FC<CatalogFilterSidebarProps> = ({
114128 style = { {
115129 height : '75vh' ,
116130 overflowY : 'auto' ,
117- background : theme . palette . background . default
131+ background : theme . palette . background . surfaces
118132 } }
119133 >
120134 < CatalogFilterSidebarState
121135 lists = { lists }
122136 onApplyFilters = { setData }
123137 value = { value }
124- styleProps = { styleProps }
138+ styleProps = { appliedStyleProps }
125139 />
126140 </ Box >
127- < Box sx = { { backgroundColor : theme . palette . border . strong , height : '5vh' } } />
128- { /* Use theme-aware color */ }
141+ < Box sx = { { backgroundColor : SLIGHT_BLUE , height : '5vh' } } />
129142 </ Box >
130143 </ Drawer >
131144 </ FilterDrawerDiv >
0 commit comments