@@ -45,8 +45,8 @@ const SetPhoneNumber = () => {
4545 . filter ( ( country ) => country . canSignUp )
4646 . map ( ( country ) => ( {
4747 key : country . iso3166alpha2 ,
48- value : country . iso3166alpha2 ,
49- label : `+ ${ country . callingCode } ${ country . name } ` ,
48+ value : ` ${ country . iso3166alpha2 } - ${ country . callingCode } ` ,
49+ label : `${ countryCodeToFlag ( country . iso3166alpha2 ) } + ${ country . callingCode } ` ,
5050 } ) ) ;
5151 } , [ registrationSettings ] ) ;
5252
@@ -131,13 +131,11 @@ const SetPhoneNumber = () => {
131131 }
132132 } ;
133133
134- const handleCountrySelect = ( key : string ) => {
134+ const handleCountrySelect = ( value : string ) => {
135135 resetPhoneVerificationSend ( ) ;
136- const areaCode = selectOptions . find ( ( option ) => option . key === key ) ?. value ;
137- if ( areaCode ) {
138- setSelectedCountryAreaCode ( areaCode ) ;
139- setSelectedCountryIsoCode ( key ) ;
140- }
136+ const [ key , areaCode ] = value . split ( '-' ) ;
137+ setSelectedCountryAreaCode ( areaCode ) ;
138+ setSelectedCountryIsoCode ( key ) ;
141139 } ;
142140
143141 const handlePhoneNumberChange = ( text : string ) => {
@@ -182,18 +180,11 @@ const SetPhoneNumber = () => {
182180 </ Label >
183181 { /* Area code selector */ }
184182 < Box twClassName = "flex flex-row items-center justify-center gap-2" >
185- < Box twClassName = "flex flex-row items-center border border-solid border-border-default rounded-lg py-1" >
186- < Text
187- variant = { TextVariant . BodyLg }
188- twClassName = "pl-3"
189- testID = "set-phone-number-country-flag"
190- >
191- { countryCodeToFlag ( selectedCountryIsoCode ) }
192- </ Text >
193- < Box twClassName = "w-28 -ml-2" >
183+ < Box twClassName = "flex flex-row items-center border border-solid border-border-default rounded-lg" >
184+ < Box twClassName = "w-22" >
194185 < SelectComponent
195186 options = { selectOptions }
196- selectedValue = { selectedCountryAreaCode }
187+ selectedValue = { ` ${ selectedCountryIsoCode } - ${ selectedCountryAreaCode } ` }
197188 onValueChange = { handleCountrySelect }
198189 label = { strings (
199190 'card.card_onboarding.set_phone_number.country_area_code_label' ,
0 commit comments