react-native-country-codes-picker
Advanced tools
Comparing version 1.1.5 to 1.2.0
import React from 'react'; | ||
import {Text, TouchableOpacity} from "react-native"; | ||
export const CountryButton = ({item, name, ...rest}) => ( | ||
export const CountryButton = ({item, name, countryButtonStyles, ...rest}) => ( | ||
<TouchableOpacity | ||
style={styles.countryButton} | ||
style={[styles.countryButton, countryButtonStyles]} | ||
{...rest} | ||
@@ -8,0 +8,0 @@ > |
@@ -9,4 +9,3 @@ import React from 'react'; | ||
export default function CountryPicker({show, pickerButtonOnPress, inputPlaceholder, searchMessage, lang = 'en'}) { | ||
// ToDo need to add prop types | ||
export default function CountryPicker({show, pickerButtonOnPress, inputPlaceholder, searchMessage, lang = 'en', style, ...restInputProps, ...restFlatListProps}) { | ||
const [animationDriver] = React.useState(new Animated.Value(0)); | ||
@@ -53,2 +52,3 @@ const [searchValue, setSearchValue] = React.useState(''); | ||
styles.modal, | ||
style?.modal, | ||
{ | ||
@@ -75,27 +75,13 @@ transform: [ | ||
<TextInput | ||
style={styles.searchBar} | ||
style={[styles.searchBar, style?.textInput]} | ||
value={searchValue} | ||
onChangeText={(text) => setSearchValue(text)} | ||
placeholder={inputPlaceholder || 'Search your country'} | ||
{...restInputProps} | ||
/> | ||
</Animated.View> | ||
</View> | ||
<View | ||
style={{ | ||
width: '100%', | ||
height: 1.5, | ||
borderRadius: 2, | ||
backgroundColor: '#eceff1', | ||
alignSelf: 'center', | ||
marginVertical: 5, | ||
}} | ||
/> | ||
<View style={styles.line}/> | ||
{resultCountries.length === 0 ? ( | ||
<View | ||
style={{ | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
height: '100%', | ||
}} | ||
> | ||
<View style={styles.countryMessage}> | ||
<Text | ||
@@ -125,2 +111,3 @@ style={{ | ||
item={item} | ||
countryButtonStyles={style?.countryButtonStyles} | ||
name={checkName} | ||
@@ -134,2 +121,3 @@ onPress={() => { | ||
}} | ||
{...restFlatListProps} | ||
/> | ||
@@ -177,3 +165,16 @@ )} | ||
padding: 5, | ||
}, | ||
countryMessage: { | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
height: '100%', | ||
}, | ||
line: { | ||
width: '100%', | ||
height: 1.5, | ||
borderRadius: 2, | ||
backgroundColor: '#eceff1', | ||
alignSelf: 'center', | ||
marginVertical: 5, | ||
} | ||
}; |
{ | ||
"name": "react-native-country-codes-picker", | ||
"version": "1.1.5", | ||
"version": "1.2.0", | ||
"description": "This lib. provide country iso picker with search functionality", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# react-native-country-codes-picker | ||
This lib. provide multi lang. country picker with search functionality. Fully crossplatform and supported on React-native and expo. | ||
Didn't find your country ? Just add the required countries or locales and make a PR. | ||
:zap: :zap: :zap: This lib. provide multi lang. country picker with search functionality. Fully crossplatform and supported on React-native and expo. | ||
Didn't find your country ? Just add the required countries or locales and make a PR. :zap: :zap: :zap: | ||
## Coming soon :) | ||
## Coming soon :muscle: :pray: | ||
@@ -12,3 +12,3 @@ 1. Custom list item rendering. | ||
4. Picker types (modal, input). If you need input with search. | ||
6. Docs update/improve for the best user experience, | ||
6. Docs update/improve for the best user experience. | ||
@@ -78,1 +78,5 @@ If you have something interesting ! Just write to us :) | ||
| lang | string | 'en' | lang={'pl'} | If you need to change the lang. just put one of supported lang. Or if you didn't find required lang just add them and make a PR :) | | ||
## Supported languages => en, ru, ua, cz, pl. | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
90467
3337
81