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

react-native-country-picker-modal

Package Overview
Dependencies
Maintainers
2
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

Comparing version 0.1.5 to 0.1.6

10

package.json
{
"name": "react-native-country-picker-modal",
"version": "0.1.5",
"version": "0.1.6",
"description": "Country picker",

@@ -23,10 +23,2 @@ "main": "src/CountryPicker.js",

"homepage": "https://github.com/xcarpentier/react-native-country-picker-modal#readme",
"devDependencies": {
"cz-conventional-changelog": "1.1.6"
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
},
"dependencies": {

@@ -33,0 +25,0 @@ "lodash": "4.12.0",

4

README.md

@@ -5,4 +5,2 @@ [**Support me with a Follow**](https://github.com/xcarpentier/followers)

[![npm version](http://img.shields.io/npm/dm/react-native-country-picker-modal.svg?style=flat-square)](https://npmjs.org/package/react-native-country-picker-modal "View this project on npm")
The best Country Picker for React Native.

@@ -31,3 +29,3 @@

```jsx
```javascript
'use strict';

@@ -34,0 +32,0 @@ import React, {

@@ -1,3 +0,1 @@

'use strict';
/**

@@ -10,16 +8,10 @@ * react-native-country-picker

import React, { Component } from 'react';
import {
StyleSheet,
View,
PixelRatio,
Image,
TouchableOpacity,
Modal,
Text,
ListView
import { StyleSheet, View, PixelRatio, Image, TouchableOpacity, Modal,
Text, ListView,
} from 'react-native';
import countries from 'world-countries';
import _ from 'lodash';
import CountryFlags from './countryFlags';
import {getWidthPercent, getHeightPercent, getPercent} from './ratio';
import { getWidthPercent, getHeightPercent, getPercent } from './ratio';
import CloseButton from './CloseButton';

@@ -31,9 +23,2 @@

super(props);
const ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2});
this.state = {
cca2: props.cca2,
currentCountry: this.getCountry(props.cca2),
modalVisible: false,
countries: ds.cloneWithRows(this.orderCountryList())
};
this.letters = _

@@ -46,2 +31,8 @@ .range('A'.charCodeAt(0), 'Z'.charCodeAt(0) + 1)

this.listHeight = countries.length * this.itemHeight;
this.state = {
modalVisible: false,
cca2: props.cca2,
currentCountry: this.getCountry(props.cca2),
};
}

@@ -55,2 +46,9 @@

componentWillReceiveProps(nextProps) {
this.setState({
cca2: nextProps.cca2,
currentCountry: this.getCountry(nextProps.cca2),
});
}
getCountryName(country) {

@@ -158,2 +156,5 @@ const translation = this.props.translation || 'eng';

render() {
const ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2});
const dataSource = ds.cloneWithRows(this.orderCountryList());
return (

@@ -180,3 +181,3 @@ <View>

ref={scrollView => { this._scrollView = scrollView; }}
dataSource={this.state.countries}
dataSource={dataSource}
renderRow={country => this.renderCountry(country)}

@@ -264,8 +265,9 @@ initialListSize={20}

onChange: React.PropTypes.func.isRequired,
closeable: React.PropTypes.bool
closeable: React.PropTypes.bool,
};
CountryPicker.defaultProps = {
translation: 'eng'
translation: 'eng',
};
module.exports = CountryPicker;
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