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

react-native-city-select

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-city-select - npm Package Compare versions

Comparing version 0.0.7 to 0.0.8

42

cityData.js
const CITY = {
HOT: [
{
cityId: '10',
cityName: '北京',
cityNameEn: 'Beijing',
},
{
cityId: '82',
cityName: '上海',
cityNameEn: 'Shanghai',
},
{
cityId: '210',
cityName: '广州',
cityNameEn: 'Guangzhou',
},
{
cityId: '221',
cityName: '深圳',
cityNameEn: 'Shenzhen',
},
{
cityId: '267',
cityName: '成都',
cityNameEn: 'Chengdu',
},
{
cityId: '179',
cityName: '武汉',
cityNameEn: 'Wuhan',
},
{
cityId: '83',
cityName: '南京',
cityNameEn: 'Nanjing',
},
{
cityId: '96',
cityName: '杭州',
cityNameEn: 'Hangzhou',
},
],
A: [

@@ -45,0 +3,0 @@ {

const CITY = {
HOT: [
{
cityId: '10',
cityName: '北京',
cityNameEn: 'Beijing',
},
{
cityId: '82',
cityName: '上海',
cityNameEn: 'Shanghai',
},
{
cityId: '210',
cityName: '广州',
cityNameEn: 'Guangzhou',
},
{
cityId: '221',
cityName: '深圳',
cityNameEn: 'Shenzhen',
},
{
cityId: '267',
cityName: '成都',
cityNameEn: 'Chengdu',
},
{
cityId: '179',
cityName: '武汉',
cityNameEn: 'Wuhan',
},
{
cityId: '83',
cityName: '南京',
cityNameEn: 'Nanjing',
},
{
cityId: '96',
cityName: '杭州',
cityNameEn: 'Hangzhou',
},
],
A: [

@@ -45,0 +3,0 @@ {

15

example/citySelect.js

@@ -48,2 +48,6 @@ import React, { Component } from 'react'

renderHeader(){
const cancelText={
color: this.props.cancelColor,
fontSize: this.props.cancelSize
}
if(this.props.header){

@@ -56,3 +60,3 @@ return(

>
<Text style={styles.cancelText}>
<Text style={cancelText}>
{this.props.cancelText}

@@ -111,2 +115,4 @@ </Text>

header: true,
cancelColor: '#51a8fb',
cancelSize : 14,
}

@@ -117,2 +123,4 @@

cancelText: React.PropTypes.string,
cancelColor: React.PropTypes.string,
cancelSize: React.PropTypes.number,
titleText: React.PropTypes.string,

@@ -146,5 +154,2 @@ cancelCity: React.PropTypes.func.isRequired,

},
cancelText: {
color: '#51a8fb',
},
title: {

@@ -162,3 +167,3 @@ backgroundColor: '#F2F2F2',

city: {
width: deviceWidth*0.25,
width: deviceWidth*1/3,
height: 40,

@@ -165,0 +170,0 @@ borderRightWidth: 1,

@@ -12,3 +12,3 @@ {

"react-native": "0.35.0",
"react-native-city-select": "0.0.2"
"react-native-city-select": "0.0.7"
},

@@ -15,0 +15,0 @@ "jest": {

@@ -48,2 +48,6 @@ import React, { Component } from 'react'

renderHeader(){
const cancelText={
color: this.props.cancelColor,
fontSize: this.props.cancelSize
}
if(this.props.header){

@@ -56,3 +60,3 @@ return(

>
<Text style={styles.cancelText}>
<Text style={cancelText}>
{this.props.cancelText}

@@ -111,2 +115,4 @@ </Text>

header: true,
cancelColor: '#51a8fb',
cancelSize : 14,
}

@@ -117,2 +123,4 @@

cancelText: React.PropTypes.string,
cancelColor: React.PropTypes.string,
cancelSize: React.PropTypes.number,
titleText: React.PropTypes.string,

@@ -146,5 +154,2 @@ cancelCity: React.PropTypes.func.isRequired,

},
cancelText: {
color: '#51a8fb',
},
title: {

@@ -162,3 +167,3 @@ backgroundColor: '#F2F2F2',

city: {
width: deviceWidth*0.25,
width: deviceWidth*1/3,
height: 40,

@@ -165,0 +170,0 @@ borderRightWidth: 1,

{
"name": "react-native-city-select",
"version": "0.0.7",
"version": "0.0.8",
"auth": "ryanyu104",

@@ -5,0 +5,0 @@ "dependencies": {},

@@ -8,2 +8,3 @@ # react-native-city-select

- [Usage](#usage)
- [Notice](#notice)
- [Options](#options)

@@ -103,2 +104,30 @@ - [Response object](#the-response-object)

###Notice
<b>Position:</b> Put the CitySelect component at the bottom of the container, avoid hierarchical relation problem.
<b>City data:</b> Get all Chinese cities data, [click here] (https://github.com/ryanyu104/react-native-city-select/blob/master/cityData.js)
```javascript
const CITY = {
A: [
{
cityId: '279',
cityName: '阿坝',
cityNameEn: 'Aba',
},
{
cityId: '329',
cityName: '安康',
cityNameEn: 'Ankang',
},
...
],
...
}
```
### Options

@@ -109,2 +138,4 @@

cancelCity | function |
cancelColor | string | '#51a8fb'
cancelSize | number | 14
selectCity | function |

@@ -111,0 +142,0 @@ cityData | object |

Sorry, the diff of this file is not supported yet

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