File tree Expand file tree Collapse file tree 3 files changed +14
-14
lines changed
src/custom/CatalogSearchSort Expand file tree Collapse file tree 3 files changed +14
-14
lines changed Original file line number Diff line number Diff line change 1
- import { InputAdornment , SxProps , Theme } from '@mui/material' ;
1
+ import { SxProps , Theme , useTheme } from '@mui/material' ;
2
2
import React from 'react' ;
3
+ import { InputAdornment } from '../../base' ;
3
4
import { SearchIcon } from '../../icons' ;
4
- import { CHARCOAL } from '../../theme' ;
5
5
import { CatalogSearchInput , InputAdornmentEnd } from './style' ;
6
6
7
7
interface CatalogSearchProps {
@@ -29,6 +29,7 @@ const CatalogSearch: React.FC<CatalogSearchProps> = ({
29
29
sx,
30
30
endText
31
31
} ) => {
32
+ const theme = useTheme ( ) ;
32
33
return (
33
34
< CatalogSearchInput
34
35
type = "search"
@@ -38,7 +39,7 @@ const CatalogSearch: React.FC<CatalogSearchProps> = ({
38
39
onChange = { handleTextFieldChange }
39
40
startAdornment = {
40
41
< InputAdornment position = "start" >
41
- < SearchIcon fill = { CHARCOAL } />
42
+ < SearchIcon fill = { theme . palette . background . neutral ?. default } />
42
43
</ InputAdornment >
43
44
}
44
45
endAdornment = { < InputAdornmentEnd position = "end" > { endText } </ InputAdornmentEnd > }
Original file line number Diff line number Diff line change 1
- import { MenuItem , Select , SelectChangeEvent } from '@mui/material' ;
1
+ import { SelectChangeEvent } from '@mui/material' ;
2
2
import React from 'react' ;
3
-
3
+ import { MenuItem , Select } from '../../base' ;
4
4
interface Option {
5
5
value : string ;
6
6
text : string ;
@@ -9,7 +9,7 @@ interface Option {
9
9
10
10
interface CatalogSortByMenuProps {
11
11
sortOrder : string ;
12
- handleChange : ( event : SelectChangeEvent < string > ) => void ;
12
+ handleChange : ( event : SelectChangeEvent < unknown > , child : React . ReactNode ) => void ;
13
13
showByLabel : string ;
14
14
options : Option [ ] ;
15
15
}
@@ -37,6 +37,7 @@ const CatalogSortByMenu: React.FC<CatalogSortByMenuProps> = ({
37
37
onChange = { handleChange }
38
38
displayEmpty
39
39
inputProps = { { 'aria-label' : 'Sort by' } }
40
+ variant = "outlined"
40
41
>
41
42
< MenuItem value = "" disabled >
42
43
{ showByLabel }
Original file line number Diff line number Diff line change 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' ;
4
3
5
4
export const CatalogSearchInput = styled ( OutlinedInput ) ( ( { style } ) => ( {
6
- backgroundColor : WHITESMOKE ,
7
5
width : '100%' ,
8
6
'@media (max-width: 590px)' : {
9
7
marginLeft : '0.25rem' ,
@@ -13,17 +11,17 @@ export const CatalogSearchInput = styled(OutlinedInput)(({ style }) => ({
13
11
...style
14
12
} ) ) ;
15
13
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 } ` ,
18
16
height : '30px' ,
19
17
paddingLeft : '10px' ,
20
18
'@media (max-width: 590px)' : {
21
19
paddingLeft : '0px'
22
20
}
23
21
} ) ) ;
24
22
25
- export const CatalogSortBy = styled ( FormControl ) ( ( ) => ( {
26
- backgroundColor : CULTURED ,
23
+ export const CatalogSortBy = styled ( FormControl ) ( ( { theme } ) => ( {
24
+ backgroundColor : theme . palette . background . supplementary ,
27
25
borderRadius : '.25rem' ,
28
26
minWidth : 'fit-content' ,
29
27
'@media (max-width: 590px)' : {
You can’t perform that action at this time.
0 commit comments