Skip to content

Commit 85bda08

Browse files
committed
chore: use theme token
Signed-off-by: Amit Amrutiya <[email protected]>
1 parent c0e4984 commit 85bda08

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

src/custom/CatalogSearchSort/CatalogSearch.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { InputAdornment, SxProps, Theme } from '@mui/material';
1+
import { SxProps, Theme, useTheme } from '@mui/material';
22
import React from 'react';
3+
import { InputAdornment } from '../../base';
34
import { SearchIcon } from '../../icons';
4-
import { CHARCOAL } from '../../theme';
55
import { CatalogSearchInput, InputAdornmentEnd } from './style';
66

77
interface CatalogSearchProps {
@@ -29,6 +29,7 @@ const CatalogSearch: React.FC<CatalogSearchProps> = ({
2929
sx,
3030
endText
3131
}) => {
32+
const theme = useTheme();
3233
return (
3334
<CatalogSearchInput
3435
type="search"
@@ -38,7 +39,7 @@ const CatalogSearch: React.FC<CatalogSearchProps> = ({
3839
onChange={handleTextFieldChange}
3940
startAdornment={
4041
<InputAdornment position="start">
41-
<SearchIcon fill={CHARCOAL} />
42+
<SearchIcon fill={theme.palette.background.neutral?.default} />
4243
</InputAdornment>
4344
}
4445
endAdornment={<InputAdornmentEnd position="end">{endText}</InputAdornmentEnd>}

src/custom/CatalogSearchSort/CatalogSortByMenu.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { MenuItem, Select, SelectChangeEvent } from '@mui/material';
1+
import { SelectChangeEvent } from '@mui/material';
22
import React from 'react';
3-
3+
import { MenuItem, Select } from '../../base';
44
interface Option {
55
value: string;
66
text: string;
@@ -9,7 +9,7 @@ interface Option {
99

1010
interface CatalogSortByMenuProps {
1111
sortOrder: string;
12-
handleChange: (event: SelectChangeEvent<string>) => void;
12+
handleChange: (event: SelectChangeEvent<unknown>, child: React.ReactNode) => void;
1313
showByLabel: string;
1414
options: Option[];
1515
}
@@ -37,6 +37,7 @@ const CatalogSortByMenu: React.FC<CatalogSortByMenuProps> = ({
3737
onChange={handleChange}
3838
displayEmpty
3939
inputProps={{ 'aria-label': 'Sort by' }}
40+
variant="outlined"
4041
>
4142
<MenuItem value="" disabled>
4243
{showByLabel}

src/custom/CatalogSearchSort/style.tsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
import { FormControl, styled } from '@mui/material';
2-
import { InputAdornment, OutlinedInput } from '../../base';
3-
import { CHINESE_SILVER, CULTURED, WHITESMOKE } from '../../theme';
1+
import { styled } from '@mui/material';
2+
import { FormControl, InputAdornment, OutlinedInput } from '../../base';
43

54
export const CatalogSearchInput = styled(OutlinedInput)(({ style }) => ({
6-
backgroundColor: WHITESMOKE,
75
width: '100%',
86
'@media (max-width: 590px)': {
97
marginLeft: '0.25rem',
@@ -13,17 +11,17 @@ export const CatalogSearchInput = styled(OutlinedInput)(({ style }) => ({
1311
...style
1412
}));
1513

16-
export const InputAdornmentEnd = styled(InputAdornment)(() => ({
17-
borderLeft: `1px solid ${CHINESE_SILVER}`,
14+
export const InputAdornmentEnd = styled(InputAdornment)(({ theme }) => ({
15+
borderLeft: `1px solid ${theme.palette.border.normal}`,
1816
height: '30px',
1917
paddingLeft: '10px',
2018
'@media (max-width: 590px)': {
2119
paddingLeft: '0px'
2220
}
2321
}));
2422

25-
export const CatalogSortBy = styled(FormControl)(() => ({
26-
backgroundColor: CULTURED,
23+
export const CatalogSortBy = styled(FormControl)(({ theme }) => ({
24+
backgroundColor: theme.palette.background.supplementary,
2725
borderRadius: '.25rem',
2826
minWidth: 'fit-content',
2927
'@media (max-width: 590px)': {

0 commit comments

Comments
 (0)