AstrOOnauta / react-native-international-phone-number

⚛️ International mobile phone number input component for React Native 📱
https://snack.expo.dev/@astroonauta/react-native-international-phone-number
ISC License
279 stars 52 forks source link

Hide the country code next to the flag #9

Closed rnwonder closed 1 year ago

rnwonder commented 1 year ago

Hey great library. I was wondering if there is a prop to hide the country code next to the flag. both on the modal and on the input. Really would appreciate being able to hide it on the input.

AstrOOnauta commented 1 year ago

Hi @rnwonder !

Thanks for using the lib and sorry for the delay in replying.

So, there is none way to you do this (directly). But, in the v0.5.0, you can use the props flagTextStyle to hide the calling code (country code) next to the main flag (not inside the modal, there's no way...not for now). See the example:

import PhoneInput from 'react-native-international-phone-number';

...

<PhoneInput
   ...
   flagTextStyle={{display: "none"}}   <------- ADD THIS
/>

I hope it's useful in your case, and I'll think more about how to implement the feature you requested.

🚀 AstrOOnauta 🚀

AstrOOnauta commented 1 year ago

@arirah

Now, you can hide the calling code inside the modal (usying the props modalStyle), too. To read more about this, visit the documentation.

See the example:

import PhoneInput from 'react-native-international-phone-number';

...

<PhoneInput
   ...
   flagTextStyle={{display: "none"}}
   modalStyle={{
     callingCode: {
        display: "none"
      },
   }}
/>

Please, update the lib react-native-international-phone-number to v0.5.3 and enjoy.

🚀 AstrOOnauta 🚀