|
1 |
| -import { Theme } from '@mui/material/styles'; |
2 |
| -import { WithStyles, createStyles, withStyles } from '@mui/styles'; |
| 1 | +import { styled } from '@mui/material/styles'; |
3 | 2 |
|
4 |
| -type ClassNames = |
5 |
| - | 'close' |
6 |
| - | 'icon' |
7 |
| - | 'input' |
8 |
| - | 'navIconHide' |
9 |
| - | 'root' |
10 |
| - | 'textfield' |
11 |
| - | 'textfieldContainer'; |
| 3 | +import { IconButton } from 'src/components/IconButton'; |
12 | 4 |
|
13 |
| -export type StyleProps = WithStyles<ClassNames>; |
| 5 | +export const StyledIconButton = styled(IconButton, { |
| 6 | + label: 'StyledIconButton', |
| 7 | +})(({ theme }) => ({ |
| 8 | + '& > span': { |
| 9 | + justifyContent: 'flex-end', |
| 10 | + }, |
| 11 | + '& svg': { |
| 12 | + height: 25, |
| 13 | + width: 25, |
| 14 | + }, |
| 15 | + '&:hover, &:focus': { |
| 16 | + color: '#c1c1c0', |
| 17 | + }, |
| 18 | + backgroundColor: 'inherit', |
| 19 | + border: 'none', |
| 20 | + color: '#c9c7c7', |
| 21 | + cursor: 'pointer', |
| 22 | + padding: theme.spacing(), |
| 23 | + position: 'relative', |
| 24 | + [theme.breakpoints.up('md')]: { |
| 25 | + display: 'none', |
| 26 | + }, |
| 27 | + top: 1, |
| 28 | +})); |
14 | 29 |
|
15 |
| -const styles = (theme: Theme) => |
16 |
| - createStyles({ |
17 |
| - close: { |
18 |
| - '& > span': { |
19 |
| - padding: 2, |
20 |
| - }, |
21 |
| - '&:hover, &:focus': { |
22 |
| - color: theme.palette.primary.main, |
23 |
| - }, |
| 30 | +export const StyledSearchBarWrapperDiv = styled('div', { |
| 31 | + label: 'StyledSearchBarWrapperDiv', |
| 32 | +})(({ theme }) => ({ |
| 33 | + '& > div .react-select__control': { |
| 34 | + backgroundColor: 'transparent', |
| 35 | + }, |
| 36 | + '& > div .react-select__indicators': { |
| 37 | + display: 'none', |
| 38 | + }, |
| 39 | + '& > div .react-select__menu': { |
| 40 | + border: 0, |
| 41 | + borderRadius: 4, |
| 42 | + boxShadow: `0 0 10px ${theme.color.boxShadowDark}`, |
| 43 | + marginTop: 12, |
| 44 | + maxHeight: 350, |
| 45 | + overflowY: 'auto', |
| 46 | + }, |
| 47 | + '& > div .react-select__menu-list': { |
| 48 | + overflowX: 'hidden', |
| 49 | + padding: 0, |
| 50 | + }, |
| 51 | + '& > div .react-select__value-container': { |
| 52 | + '& p': { |
| 53 | + fontSize: '0.875rem', |
| 54 | + overflow: 'visible', |
24 | 55 | },
|
25 |
| - icon: { |
26 |
| - color: '#c9cacb', |
27 |
| - fontSize: '2rem', |
| 56 | + overflow: 'hidden', |
| 57 | + }, |
| 58 | + alignItems: 'center', |
| 59 | + backgroundColor: theme.bg.app, |
| 60 | + borderRadius: 3, |
| 61 | + display: 'flex', |
| 62 | + flex: 1, |
| 63 | + height: 34, |
| 64 | + marginLeft: theme.spacing(1), |
| 65 | + padding: theme.spacing(1), |
| 66 | + position: 'relative', // for search results |
| 67 | + [theme.breakpoints.down('md')]: { |
| 68 | + '&.active': { |
| 69 | + opacity: 1, |
| 70 | + visibility: 'visible', |
| 71 | + zIndex: 3, |
28 | 72 | },
|
29 |
| - input: { |
30 |
| - '& input': { |
31 |
| - fontSize: '1.0em', |
32 |
| - [theme.breakpoints.down('md')]: {}, |
33 |
| - transition: theme.transitions.create(['opacity']), |
34 |
| - }, |
35 |
| - background: 'transparent', |
36 |
| - border: 0, |
37 |
| - maxWidth: '100%', |
38 |
| - }, |
39 |
| - navIconHide: { |
40 |
| - '& > span': { |
41 |
| - justifyContent: 'flex-end', |
42 |
| - }, |
43 |
| - '& svg': { |
44 |
| - height: 25, |
45 |
| - width: 25, |
46 |
| - }, |
47 |
| - '&:hover, &:focus': { |
48 |
| - color: '#c1c1c0', |
49 |
| - }, |
50 |
| - backgroundColor: 'inherit', |
51 |
| - border: 'none', |
52 |
| - color: '#c9c7c7', |
53 |
| - cursor: 'pointer', |
54 |
| - padding: theme.spacing(), |
55 |
| - position: 'relative', |
56 |
| - [theme.breakpoints.up('md')]: { |
57 |
| - display: 'none', |
58 |
| - }, |
59 |
| - top: 1, |
60 |
| - }, |
61 |
| - root: { |
62 |
| - '& .react-select__control': { |
63 |
| - backgroundColor: 'transparent', |
64 |
| - }, |
65 |
| - '& .react-select__indicators': { |
66 |
| - display: 'none', |
67 |
| - }, |
68 |
| - '& .react-select__menu': { |
69 |
| - border: 0, |
70 |
| - borderRadius: 4, |
71 |
| - boxShadow: `0 0 10px ${theme.color.boxShadowDark}`, |
72 |
| - marginTop: 12, |
73 |
| - maxHeight: 350, |
74 |
| - overflowY: 'auto', |
75 |
| - }, |
76 |
| - '& .react-select__menu-list': { |
77 |
| - overflowX: 'hidden', |
78 |
| - padding: 0, |
79 |
| - }, |
80 |
| - '& .react-select__value-container': { |
81 |
| - '& p': { |
82 |
| - overflow: 'visible', |
83 |
| - }, |
84 |
| - fontSize: '0.875rem', |
85 |
| - overflow: 'hidden', |
86 |
| - }, |
87 |
| - '& .select-placeholder': { |
88 |
| - opacity: 1, |
89 |
| - transition: theme.transitions.create(['opacity'], { |
90 |
| - duration: theme.transitions.duration.shortest, |
91 |
| - }), |
92 |
| - }, |
93 |
| - '&.active': { |
94 |
| - '& .select-placeholder': { |
95 |
| - opacity: 0.5, |
96 |
| - }, |
97 |
| - }, |
98 |
| - alignItems: 'center', |
99 |
| - backgroundColor: theme.bg.app, |
100 |
| - borderRadius: 3, |
101 |
| - display: 'flex', |
102 |
| - flex: 1, |
103 |
| - height: 34, |
104 |
| - marginLeft: theme.spacing(1), |
105 |
| - padding: theme.spacing(1), |
106 |
| - position: 'relative' /* for search results */, |
107 |
| - [theme.breakpoints.down('md')]: { |
108 |
| - '&.active': { |
109 |
| - opacity: 1, |
110 |
| - visibility: 'visible', |
111 |
| - zIndex: 3, |
112 |
| - }, |
113 |
| - backgroundColor: theme.bg.white, |
114 |
| - left: 0, |
115 |
| - margin: 0, |
116 |
| - opacity: 0, |
117 |
| - position: 'absolute', |
118 |
| - visibility: 'hidden', |
119 |
| - width: 'calc(100% - 100px)', |
120 |
| - zIndex: -1, |
121 |
| - }, |
122 |
| - [theme.breakpoints.down('sm')]: { |
123 |
| - width: '100%', |
124 |
| - }, |
125 |
| - transition: theme.transitions.create(['opacity']), |
126 |
| - }, |
127 |
| - textfield: { |
128 |
| - '& input:focus': { |
129 |
| - outline: '1px dotted #606469', |
130 |
| - }, |
131 |
| - flex: 1, |
132 |
| - margin: 0, |
133 |
| - minHeight: 'initial', |
134 |
| - }, |
135 |
| - textfieldContainer: { |
136 |
| - [theme.breakpoints.down('md')]: {}, |
137 |
| - width: '100%', |
138 |
| - }, |
139 |
| - }); |
140 |
| - |
141 |
| -export default withStyles(styles); |
| 73 | + backgroundColor: theme.bg.white, |
| 74 | + left: 0, |
| 75 | + margin: 0, |
| 76 | + opacity: 0, |
| 77 | + position: 'absolute', |
| 78 | + visibility: 'hidden', |
| 79 | + width: 'calc(100% - 100px)', |
| 80 | + zIndex: -1, |
| 81 | + }, |
| 82 | + [theme.breakpoints.down('sm')]: { |
| 83 | + width: '100%', |
| 84 | + }, |
| 85 | + transition: theme.transitions.create(['opacity']), |
| 86 | +})); |
0 commit comments