react-native-phone-number-input icon indicating copy to clipboard operation
react-native-phone-number-input copied to clipboard

feat: add optional flat flags instead of default emoji flags

Open TanKucukhas opened this issue 2 years ago • 3 comments

This will add a flatFlags boolean to able to display flat flags instead of emoji flags. Screen Shot 2021-10-08 at 8 20 21 PM

TanKucukhas avatar Oct 09 '21 00:10 TanKucukhas

Hi, Thanks for this, To override this feature you can use countryPickerProps

garganurag893 avatar Mar 22 '22 15:03 garganurag893

Hi, Thanks for this, To override this feature you can use countryPickerProps

I think the P.R is good, but using countryPickerProps is what works well too, so don't have to add a seperate prop for this.

anwersolangi avatar May 20 '22 14:05 anwersolangi

countryPickerProps only works in the picker, but if we use the layout="first" we get the same emoji flag, to fix that just change the code of https://github.com/garganurag893/react-native-phone-number-input/blob/ccd16fc20d8a0a476867417279932db0e41fdb2b/lib/index.js#L130 to:

const { layout = "first", flagSize, countryPickerProps } = this.props;
    const { countryCode } = this.state;
    if (layout === "first") {
      return (
        <Flag
          withEmoji={countryPickerProps?.withEmoji}
          countryCode={countryCode}
          flagSize={flagSize ? flagSize : DEFAULT_THEME.flagSize}
        />
      );
    }

anwersolangi avatar May 20 '22 14:05 anwersolangi