1
+ import { regional } from '@suite-common/trading' ;
1
2
import { BottomSheetFlashList } from '@suite-native/atoms' ;
2
3
import { Translation } from '@suite-native/intl' ;
3
4
@@ -13,21 +14,7 @@ export type CountrySheetProps = {
13
14
selectedCountryId ?: string ;
14
15
} ;
15
16
16
- const mockCountries : Country [ ] = [
17
- { id : 'us' , name : 'United States' , flag : 'flag' } ,
18
- { id : 'cz' , name : 'Czech Republic' , flag : 'flagCheckered' } ,
19
- { id : 'sk' , name : 'Slovakia' , flag : 'flag' } ,
20
- { id : 'de' , name : 'Germany' , flag : 'flagCheckered' } ,
21
- { id : 'fr' , name : 'France' , flag : 'flag' } ,
22
- { id : 'es' , name : 'Spain' , flag : 'flagCheckered' } ,
23
- { id : 'it' , name : 'Italy' , flag : 'flag' } ,
24
- { id : 'pl' , name : 'Poland' , flag : 'flagCheckered' } ,
25
- { id : 'hu' , name : 'Hungary' , flag : 'flag' } ,
26
- { id : 'at' , name : 'Austria' , flag : 'flagCheckered' } ,
27
- { id : 'ch' , name : 'Switzerland' , flag : 'flag' } ,
28
- ] ;
29
-
30
- const keyExtractor = ( item : Country ) => item . id ;
17
+ const keyExtractor = ( item : Country ) => item . value ;
31
18
const getEstimatedListHeight = ( itemsCount : number ) => itemsCount * COUNTRY_LIST_ITEM_HEIGHT ;
32
19
33
20
export const CountrySheet = ( {
@@ -41,8 +28,6 @@ export const CountrySheet = ({
41
28
onClose ( ) ;
42
29
} ;
43
30
44
- const data : Country [ ] = mockCountries ;
45
-
46
31
return (
47
32
< BottomSheetFlashList < Country >
48
33
isVisible = { isVisible }
@@ -58,11 +43,11 @@ export const CountrySheet = ({
58
43
< CountryListItem
59
44
{ ...item }
60
45
onPress = { ( ) => onCountrySelectCallback ( item ) }
61
- isSelected = { item . id === selectedCountryId }
46
+ isSelected = { item . value === selectedCountryId }
62
47
/>
63
48
) }
64
- data = { data }
65
- estimatedListHeight = { getEstimatedListHeight ( data . length ) }
49
+ data = { regional . countriesOptions }
50
+ estimatedListHeight = { getEstimatedListHeight ( regional . countriesOptions . length ) }
66
51
estimatedItemSize = { COUNTRY_LIST_ITEM_HEIGHT }
67
52
keyExtractor = { keyExtractor }
68
53
/>
0 commit comments