Skip to content

Commit 6e26e94

Browse files
authored
Merge pull request #758 from amitamrutiya/generate/enhancement
Enhancement on new created sistent component
2 parents 1abcf4e + ae4c0ce commit 6e26e94

4 files changed

Lines changed: 193 additions & 204 deletions

File tree

src/custom/CatalogFilterSection/CatalogFilterSidebar.tsx

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { useTheme } from '@mui/material/styles';
33
import { useCallback, useState } from 'react';
44
import { Box, Drawer, Typography } from '../../base';
55
import { CloseIcon } from '../../icons';
6+
import { darkTeal } from '../../theme';
67
import { CloseBtn } from '../Modal';
78
import CatalogFilterSidebarState from './CatalogFilterSidebarState';
89
import {
@@ -69,8 +70,12 @@ const CatalogFilterSidebar: React.FC<CatalogFilterSidebarProps> = ({
6970
}, []);
7071

7172
const styleProps: StyleProps = {
72-
backgroundColor: theme.palette.background.default,
73-
sectionTitleBackgroundColor: theme.palette.background.surfaces
73+
backgroundColor:
74+
theme.palette.mode === 'light'
75+
? theme.palette.background.default
76+
: theme.palette.background.secondary,
77+
sectionTitleBackgroundColor:
78+
theme.palette.mode === 'light' ? theme.palette.background.surfaces : darkTeal.main
7479
};
7580

7681
return (
@@ -89,7 +94,13 @@ const CatalogFilterSidebar: React.FC<CatalogFilterSidebarProps> = ({
8994
<FilterText>Filters</FilterText>
9095
</FilterButton>
9196

92-
<Drawer anchor="bottom" open={openDrawer} variant="temporary" onClose={handleDrawerClose}>
97+
<Drawer
98+
anchor="bottom"
99+
open={openDrawer}
100+
variant="temporary"
101+
onClose={handleDrawerClose}
102+
style={{ zIndex: '1399' }}
103+
>
93104
<Box sx={{ overflowY: 'hidden', height: '90vh' }}>
94105
<FiltersDrawerHeader>
95106
<Typography variant="h6" sx={{ color: theme.palette.text.default }} component="div">

src/custom/CatalogFilterSection/FilterSection.tsx

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,11 @@
11
import ExpandLessIcon from '@mui/icons-material/ExpandLess';
22
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
33
import { useCallback, useState } from 'react';
4-
import {
5-
Box,
6-
Checkbox,
7-
Collapse,
8-
InputAdornment,
9-
List,
10-
OutlinedInput,
11-
Stack,
12-
Typography
13-
} from '../../base';
14-
import { SearchIcon } from '../../icons';
4+
import { Box, Checkbox, Collapse, List, Stack, Typography } from '../../base';
155
import { InfoTooltip } from '../CustomTooltip';
6+
import { StyledSearchBar } from '../StyledSearchBar';
167
import { FilterOption, FilterValues, StyleProps } from './CatalogFilterSidebar';
17-
import { FilterTitleButton, InputAdornmentEnd } from './style';
8+
import { EndAdornmentText, FilterTitleButton } from './style';
189

1910
interface FilterSectionProps {
2011
filterKey: string;
@@ -81,22 +72,13 @@ const FilterSection: React.FC<FilterSectionProps> = ({
8172
}}
8273
>
8374
{showSearch && (
84-
<Box px={'0.5rem'}>
85-
<OutlinedInput
86-
type="search"
87-
fullWidth
88-
placeholder="Search "
75+
<Box px={'0.5rem'} mb={'0.5rem'}>
76+
<StyledSearchBar
8977
value={searchQuery}
9078
onChange={handleTextFieldChange}
91-
startAdornment={
92-
<InputAdornment position="start">
93-
<SearchIcon />
94-
</InputAdornment>
95-
}
79+
placeholder="Search"
9680
endAdornment={
97-
<InputAdornmentEnd position="end">
98-
Total: {searchedOptions.length}
99-
</InputAdornmentEnd>
81+
<EndAdornmentText> Total : {searchedOptions.length ?? 0}</EndAdornmentText>
10082
}
10183
/>
10284
</Box>

src/custom/CatalogFilterSection/style.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { styled } from '@mui/material/styles';
2-
import { Box, Button, InputAdornment, ListItemButton } from '../../base';
2+
import { Box, Button, ListItemButton } from '../../base';
33
import { StyleProps } from './CatalogFilterSidebar';
44

55
export const FiltersCardDiv = styled(Box)<{ styleProps: StyleProps }>(({ styleProps }) => ({
@@ -66,13 +66,8 @@ export const FilterTitleButton = styled(ListItemButton)(({ theme }) => ({
6666
justifyContent: 'space-between'
6767
}));
6868

69-
export const InputAdornmentEnd = styled(InputAdornment)(({ theme }) => ({
70-
borderLeft: `1px solid ${theme.palette.text.disabled}`,
71-
height: '30px',
72-
paddingLeft: '10px',
73-
'@media (max-width: 590px)': {
74-
paddingLeft: '0px'
75-
}
69+
export const EndAdornmentText = styled('p')(({ theme }) => ({
70+
color: theme.palette.text.tertiary
7671
}));
7772

7873
export const FilterText = styled('span')(() => ({

0 commit comments

Comments
 (0)