xcarpentier / react-native-country-picker-modal

🇦🇶 Country picker provides a modal allowing a user to select a country from a list. It display a flag next to each country name.
https://reactnative.gallery/xcarpentier/country-picker
MIT License
1.08k stars 802 forks source link

How to use renderFlagButton #338

Closed matt-dalton closed 4 years ago

matt-dalton commented 4 years ago

Issue Description

I was hoping renderFlagButton would allow me to just build my own component for the button with some data passed in, but it looks more complex than that.

Steps to Reproduce / Code Snippets

The props I receive in the function are

export interface FlagButtonProps {
    withEmoji?: boolean;
    withCountryNameButton?: boolean;
    withCurrencyButton?: boolean;
    withCallingCodeButton?: boolean;
    withFlagButton?: boolean;
    containerButtonStyle?: StyleProp<ViewStyle>;
    countryCode?: CountryCode;
    placeholder: string;
    onOpen?(): void;
}

I'm not sure how I can use these props to build my own component...they seem only useful if you're using the libraries internal flag button component

Expected Results

I was hoping to receive some props like: country countryEmoji countryName etc

Then I could build a component that displays what I want. e.g. right now, I don't seem to be able to customise the font weight

Additional Information

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.