react-native-country-codes-picker
Advanced tools
Comparing version 1.4.1 to 1.4.2
@@ -9,5 +9,5 @@ import React from 'react'; | ||
Dimensions, | ||
KeyboardAvoidingView, | ||
Easing, | ||
Keyboard, TouchableOpacity, | ||
Platform, | ||
Keyboard | ||
} from 'react-native'; | ||
@@ -39,17 +39,17 @@ import {countryCodes} from '../constants/countryCodes'; | ||
export default function CountryPicker({ | ||
show, | ||
pickerButtonOnPress, | ||
inputPlaceholder, | ||
searchMessage, | ||
lang = 'en', | ||
style, | ||
enableModalAvoiding, | ||
androidWindowSoftInputMode, | ||
onBackdropPress, | ||
disableBackdrop, | ||
excludedCountries = [], | ||
initialState, | ||
itemTemplate: ItemTemplate = CountryButton, | ||
...rest | ||
}) { | ||
show, | ||
pickerButtonOnPress, | ||
inputPlaceholder, | ||
searchMessage, | ||
lang = 'en', | ||
style, | ||
enableModalAvoiding, | ||
androidWindowSoftInputMode, | ||
onBackdropPress, | ||
disableBackdrop, | ||
excludedCountries = [], | ||
initialState, | ||
itemTemplate: ItemTemplate = CountryButton, | ||
...rest | ||
}) { | ||
const codes = countryCodes?.map(country => { | ||
@@ -108,4 +108,6 @@ if (excludedCountries?.find(short => country?.code === short?.toUpperCase())) | ||
const lowerCaseSearchValue = searchValue.toLowerCase(); | ||
return codes.filter((country) => | ||
country?.name[lang || 'en'].includes(searchValue) | ||
country?.name[lang || 'en'].toLowerCase().includes(lowerCaseSearchValue) | ||
); | ||
@@ -265,2 +267,3 @@ }, [searchValue]); | ||
width: '100%', | ||
maxWidth: Platform.OS === "web" ? 600 : undefined, | ||
borderTopRightRadius: 15, | ||
@@ -267,0 +270,0 @@ borderTopLeftRadius: 15, |
@@ -1,1 +0,2 @@ | ||
export default from "./components/CountryPicker"; | ||
import CountryPicker from './components/CountryPicker'; | ||
export default CountryPicker; |
{ | ||
"name": "react-native-country-codes-picker", | ||
"version": "1.4.1", | ||
"version": "1.4.2", | ||
"description": "This lib. provide country iso picker with search functionality", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
3978
92384