diff --git a/components/CountryButton.tsx b/components/CountryButton.tsx index f7403b4..60aedf4 100644 --- a/components/CountryButton.tsx +++ b/components/CountryButton.tsx @@ -1,33 +1,42 @@ -import React from 'react'; -import { Text, TouchableOpacity, ViewStyle } from "react-native"; -import { ItemTemplateProps } from "../types/Types"; +import React from "react"; +import {ItemTemplateProps} from "../types/Types"; +import { Text, TouchableOpacity, ViewStyle, StyleProp, TextStyle } from "react-native"; +interface CountryButtonProps extends ItemTemplateProps { + showDialCode?: boolean; + style?: { + countryButtonStyles?: StyleProp; + flag?: StyleProp; + dialCode?: StyleProp; + countryName?: StyleProp; + }; +} -export const CountryButton = ({ item, name, style, ...rest }: ItemTemplateProps) => ( - - - {item?.flag} - - - {item?.dial_code} - - - {name} - - +export const CountryButton = ({item, name, style, showDialCode = true, ...rest}: CountryButtonProps) => ( + + + {item?.flag} + + {showDialCode && ( + + {item?.dial_code} + + )} + + {name} + + ); type StyleKeys = 'countryButton';