11import FilterAltIcon from '@mui/icons-material/FilterAlt' ;
2+ import { useTheme } from '@mui/material/styles' ;
23import { useCallback , useState } from 'react' ;
34import { Box , Drawer , Typography } from '../../base' ;
45import { CloseIcon } from '../../icons' ;
5- import { CULTURED , DARK_SLATE_GRAY , WHITE } from '../../theme' ;
66import { CloseBtn } from '../Modal' ;
77import CatalogFilterSidebarState from './CatalogFilterSidebarState' ;
88import {
@@ -50,13 +50,14 @@ export interface StyleProps {
5050 * @description A functional component that renders the filter sidebar.
5151 * @param {Array } value - The data to be filtered.
5252 * @param {Function } setData - A function to set the filtered data.
53- * @param {Array } lists - An array of filter sections and it's options lists.
53+ * @param {Array } lists - An array of filter sections and its options lists.
5454 */
5555const CatalogFilterSidebar : React . FC < CatalogFilterSidebarProps > = ( {
5656 lists,
5757 setData,
5858 value = { }
5959} ) => {
60+ const theme = useTheme ( ) ; // Get the current theme
6061 const [ openDrawer , setOpenDrawer ] = useState < boolean > ( false ) ;
6162
6263 const handleDrawerOpen = useCallback ( ( ) => {
@@ -68,8 +69,8 @@ const CatalogFilterSidebar: React.FC<CatalogFilterSidebarProps> = ({
6869 } , [ ] ) ;
6970
7071 const styleProps : StyleProps = {
71- backgroundColor : WHITE ,
72- sectionTitleBackgroundColor : CULTURED
72+ backgroundColor : theme . palette . background . default ,
73+ sectionTitleBackgroundColor : theme . palette . background . surfaces
7374 } ;
7475
7576 return (
@@ -84,14 +85,14 @@ const CatalogFilterSidebar: React.FC<CatalogFilterSidebarProps> = ({
8485 </ FiltersCardDiv >
8586 < FilterDrawerDiv >
8687 < FilterButton variant = "contained" onClick = { handleDrawerOpen } >
87- < FilterAltIcon height = "20" width = "20" fill = { WHITE } />
88+ < FilterAltIcon height = "20" width = "20" fill = { theme . palette . text . default } />
8889 < FilterText > Filters</ FilterText >
8990 </ FilterButton >
9091
9192 < Drawer anchor = "bottom" open = { openDrawer } variant = "temporary" onClose = { handleDrawerClose } >
9293 < Box sx = { { overflowY : 'hidden' , height : '90vh' } } >
9394 < FiltersDrawerHeader >
94- < Typography variant = "h6" sx = { { color : WHITE } } component = "div" >
95+ < Typography variant = "h6" sx = { { color : theme . palette . text . default } } component = "div" >
9596 Filters
9697 </ Typography >
9798 < CloseBtn onClick = { handleDrawerClose } >
@@ -102,7 +103,7 @@ const CatalogFilterSidebar: React.FC<CatalogFilterSidebarProps> = ({
102103 style = { {
103104 height : '75vh' ,
104105 overflowY : 'auto' ,
105- background : WHITE
106+ background : theme . palette . background . default
106107 } }
107108 >
108109 < CatalogFilterSidebarState
@@ -112,7 +113,8 @@ const CatalogFilterSidebar: React.FC<CatalogFilterSidebarProps> = ({
112113 styleProps = { styleProps }
113114 />
114115 </ Box >
115- < Box sx = { { backgroundColor : DARK_SLATE_GRAY , height : '5vh' } } />
116+ < Box sx = { { backgroundColor : theme . palette . border . strong , height : '5vh' } } />
117+ { /* Use theme-aware color */ }
116118 </ Box >
117119 </ Drawer >
118120 </ FilterDrawerDiv >
0 commit comments