Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-country-codes-picker

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-country-codes-picker - npm Package Compare versions

Comparing version 1.1.3 to 1.1.5

29

components/CountryPicker.js

@@ -9,3 +9,3 @@ import React from 'react';

export default function CountryPicker({show, pickerButtonOnPress, inputPlaceholder, searchMessage, lang}) {
export default function CountryPicker({show, pickerButtonOnPress, inputPlaceholder, searchMessage, lang = 'en'}) {
// ToDo need to add prop types

@@ -115,13 +115,18 @@ const [animationDriver] = React.useState(new Animated.Value(0));

initialNumToRender={7}
renderItem={({item, index}) => (
<CountryButton
key={index}
item={item}
name={item?.name[lang || 'en']}
onPress={() => {
pickerButtonOnPress(item)
closeModal()
}}
/>
)}
renderItem={({item, index}) => {
let itemName = item?.name[lang];
let checkName = itemName.length ? itemName : item?.name['en'];
return(
<CountryButton
key={index}
item={item}
name={checkName}
onPress={() => {
pickerButtonOnPress(item)
closeModal()
}}
/>
)
}}
/>

@@ -128,0 +133,0 @@ )}

{
"name": "react-native-country-codes-picker",
"version": "1.1.3",
"version": "1.1.5",
"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 simple country picker with search functionality. Fully crossplatform and created on react-native.
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.
## Coming soon :)
1. Custom list item rendering.
2. Custom search input rendering.
3. Custom styling.
4. Picker types (modal, input). If you need input with search.
6. Docs update/improve for the best user experience,
If you have something interesting ! Just write to us :)
# Installation

@@ -62,12 +73,5 @@

| show | boolean | | | This prop using for displaying the modal. Put your show state here. |
| pickerButtonOnPress | function | | (country) => setCode(country.dial_code) | Put your function/functions here for getting country data from picker. |
# ToDo
1. Custom styling.
2. Picker types (modal, input). If you need input with search.
3. Dark theme option.
4. Multi lang. (for supporting more languages).
5. More speed optimization.
If you have something interesting ! Just write to us :)
| pickerButtonOnPress | function | | (country) => setCode(country.dial_code) | Put your function/functions here for getting country data from picker. |
| inputPlaceholder | string | | inputPlaceholder={'Your placeholder'} | If you need a custom placeholder for your input you may need this prop. |
| searchMessage | string | | searchMessage={'Some search message here'} | If you want to customize search message just use this prop. |
| 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 :) |

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc