@@ -11,6 +11,8 @@ import ClickAwayListener from '@mui/material/ClickAwayListener';
11
11
import { CountryCodeData } from '../../../Theme.types' ;
12
12
import ComponentIcPhoneDbg from '../../../svg/ComponentIcPhoneDbg' ;
13
13
import IcErrorIfo from '../../../svg/IcErrorIfo' ;
14
+ import ComponentIcPhoneDbgBlack from '../../../svg/ComponentIcPhoneDbgBlack' ;
15
+ import { Mode } from 'components/main.types' ;
14
16
15
17
const DEFAULT_WIDTH = 320 ;
16
18
const DEFAULT_HEIGHT = 50 ;
@@ -20,15 +22,19 @@ const Root = styled(Box)(({}) => ({
20
22
flexDirection : 'column' ,
21
23
} ) ) ;
22
24
23
- const TextField = styled ( Box ) ( ( { theme } ) => ( {
25
+ interface ModeProps {
26
+ mode ?: Mode ;
27
+ }
28
+
29
+ const TextField = styled ( Box ) < ModeProps > ( ( { theme, mode } ) => ( {
24
30
...theme . text . Body_16_Reg ,
25
31
display : 'flex' ,
26
32
alignItems : 'center' ,
27
33
minWidth : DEFAULT_WIDTH ,
28
34
height : DEFAULT_HEIGHT ,
29
35
minHeight : DEFAULT_HEIGHT ,
30
- color : '#FFFFFF ',
31
- backgroundColor : 'rgba(0, 0, 0, .5)' ,
36
+ color : mode === 'light' ? theme . color . secondary . $100 : '#FFF ',
37
+ backgroundColor : mode === 'light' ? '#F5F5F5' : 'rgba(0, 0, 0, .5)' ,
32
38
borderRadius : 4 ,
33
39
padding : '13px 24px' ,
34
40
'&.container--error' : {
@@ -48,10 +54,10 @@ const PhoneCode = styled(Box)(({}) => ({
48
54
} ,
49
55
} ) ) ;
50
56
51
- const Input = styled ( InputBase ) ( ( { theme } ) => ( {
57
+ const Input = styled ( InputBase ) < ModeProps > ( ( { theme, mode } ) => ( {
52
58
...theme . text . Body_16_Reg ,
53
59
flex : 1 ,
54
- color : 'white' ,
60
+ color : mode === 'light' ? theme . color . secondary . $100 : 'white' ,
55
61
backgroundColor : 'transparent' ,
56
62
outline : 'none' ,
57
63
border : 'none' ,
@@ -60,10 +66,10 @@ const Input = styled(InputBase)(({ theme }) => ({
60
66
} ,
61
67
} ) ) ;
62
68
63
- const Separator = styled ( Box ) ( ( { } ) => ( {
69
+ const Separator = styled ( Box ) < ModeProps > ( ( { mode } ) => ( {
64
70
width : 2 ,
65
71
height : '100%' ,
66
- border : ' 1px solid # FFFFFF',
72
+ border : ` 1px solid ${ mode === 'light' ? '#3E3E3E' : '# FFFFFF'} ` ,
67
73
borderRadius : 1 ,
68
74
} ) ) ;
69
75
@@ -122,6 +128,7 @@ const PhoneTextField: VFC<PhoneTextFieldProps> = (props) => {
122
128
error,
123
129
errorMessage,
124
130
popperProps,
131
+ mode,
125
132
...otherProps
126
133
} = props ;
127
134
const containerDOM = useRef < HTMLDivElement > ( null ) ;
@@ -186,23 +193,29 @@ const PhoneTextField: VFC<PhoneTextFieldProps> = (props) => {
186
193
className = { classnames ( {
187
194
'container--error' : error ,
188
195
} ) }
196
+ mode = { mode }
189
197
{ ...otherProps }
190
198
>
191
- < ComponentIcPhoneDbg style = { { marginRight : 6 } } />
199
+ { mode === 'light' ? (
200
+ < ComponentIcPhoneDbgBlack style = { { marginRight : 6 } } />
201
+ ) : (
202
+ < ComponentIcPhoneDbg style = { { marginRight : 6 } } />
203
+ ) }
192
204
< PhoneCode onClick = { ( ) => setShowMenu ( ! showMenu ) } >
193
205
< span className = "code-text" > { `+${ selectedCode } ` } </ span >
194
206
{ showMenu ? (
195
207
< KeyboardArrowUp style = { { margin : '0 6px' } } />
196
208
) : (
197
209
< KeyboardArrowDownIcon style = { { margin : '0 6px' } } />
198
210
) }
199
- < Separator />
211
+ < Separator mode = { mode } />
200
212
</ PhoneCode >
201
213
< Input
202
214
type = "tel"
203
215
placeholder = { placeholder }
204
216
value = { inputValue }
205
217
onChange = { handleInputOnChange }
218
+ mode = { mode }
206
219
{ ...inputProps }
207
220
/>
208
221
</ TextField >
0 commit comments