@@ -91,7 +91,7 @@ interface CountryCodeDropdownItemProps {
91
91
const CountryCodeDropdownPicker : React . FC < CountryCodeProps > = ( {
92
92
selected,
93
93
setSelected,
94
- setCountryDetails = ( ) => { } ,
94
+ setCountryDetails = ( details : CountryCodeDropdownItemProps ) => { } ,
95
95
phone,
96
96
setPhone,
97
97
countryCodeContainerStyles = { } ,
@@ -161,7 +161,7 @@ const CountryCodeDropdownPicker: React.FC<CountryCodeProps> = ({
161
161
< Text style = { [ countryCodeTextStyles ] } > { selected } </ Text >
162
162
</ View >
163
163
</ TouchableOpacity >
164
- { phone != undefined && setPhone != undefined ? (
164
+ { phone != undefined && setPhone != undefined && (
165
165
< TextInput
166
166
style = { [
167
167
{
@@ -181,20 +181,20 @@ const CountryCodeDropdownPicker: React.FC<CountryCodeProps> = ({
181
181
onChangeText = { setPhone }
182
182
value = { phone }
183
183
/>
184
- ) : (
185
- < > </ >
186
184
) }
187
185
</ View >
188
186
) ;
189
187
} else {
190
188
return (
191
189
< View style = { [ styles . inputBoxContainer , searchStyles ] } >
192
190
< View style = { [ styles . row , { width : "90%" } ] } >
193
- < Image
194
- source = { _static . search }
195
- resizeMode = { "contain" }
196
- style = { [ styles . icon , { width : 15 , height : 15 , marginLeft : 10 } ] }
197
- />
191
+ { _static . search && (
192
+ < Image
193
+ source = { _static . search }
194
+ resizeMode = { "contain" }
195
+ style = { [ styles . icon , { width : 15 , height : 15 , marginLeft : 10 } ] }
196
+ />
197
+ ) }
198
198
< TextInput
199
199
style = { [
200
200
{ marginLeft : 5 , paddingVertical : 3 , flex : 1 } ,
@@ -209,11 +209,13 @@ const CountryCodeDropdownPicker: React.FC<CountryCodeProps> = ({
209
209
onPress = { ( ) => slideUp ( ) }
210
210
style = { { marginHorizontal : 10 } }
211
211
>
212
- < Image
213
- source = { _static . close }
214
- resizeMode = { "contain" }
215
- style = { styles . icon }
216
- />
212
+ { _static . close && (
213
+ < Image
214
+ source = { _static . close }
215
+ resizeMode = { "contain" }
216
+ style = { styles . icon }
217
+ />
218
+ ) }
217
219
</ TouchableOpacity >
218
220
</ View >
219
221
) ;
@@ -247,7 +249,7 @@ const CountryCodeDropdownPicker: React.FC<CountryCodeProps> = ({
247
249
< View style = { styles . container } >
248
250
{ RenderBtn ( ) }
249
251
250
- { _selected ? (
252
+ { _selected && (
251
253
< Animated . View style = { { maxHeight : slideAnim } } >
252
254
< FlatList
253
255
data = { _countries }
@@ -262,8 +264,6 @@ const CountryCodeDropdownPicker: React.FC<CountryCodeProps> = ({
262
264
}
263
265
/>
264
266
</ Animated . View >
265
- ) : (
266
- < > </ >
267
267
) }
268
268
</ View >
269
269
) ;
0 commit comments