Skip to content

Commit

Permalink
Rename project
Browse files Browse the repository at this point in the history
  • Loading branch information
peacechen committed Aug 8, 2017
1 parent 849c0b8 commit 7fd3beb
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 23 deletions.
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
[![npm version](https://badge.fury.io/js/react-native-modal-picker.svg)](https://badge.fury.io/js/react-native-modal-picker)

# react-native-modal-picker
# react-native-modal-selector
A cross-platform (iOS / Android), selector/picker component for React Native that is highly customizable and supports sections.

## Demo
Expand All @@ -10,7 +8,7 @@ A cross-platform (iOS / Android), selector/picker component for React Native tha
## Install

```sh
npm i react-native-modal-picker --save
npm i react-native-modal-selector --save
```

## Usage
Expand All @@ -21,7 +19,7 @@ See `SampleApp` for an example how to use this component.

```jsx

import ModalPicker from 'react-native-modal-picker'
import ModalSelector from 'react-native-modal-selector'

[..]

Expand Down Expand Up @@ -58,12 +56,12 @@ class SampleApp extends Component {
return (
<View style={{flex:1, justifyContent:'space-around', padding:50}}>

<ModalPicker
<ModalSelector
data={data}
initValue="Select something yummy!"
onChange={(option)=>{ alert(`${option.label} (${option.key}) nom nom nom`) }} />

<ModalPicker
<ModalSelector
data={data}
initValue="Select something yummy!"
onChange={(option)=>{ this.setState({textInputValue:option.label})}}>
Expand All @@ -74,7 +72,7 @@ class SampleApp extends Component {
placeholder="Select something yummy!"
value={this.state.textInputValue} />

</ModalPicker>
</ModalSelector>
</View>
);
}
Expand Down
12 changes: 6 additions & 6 deletions SampleApp/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
TextInput
} from 'react-native';

import ModalPicker from 'react-native-modal-picker'
import ModalSelector from 'react-native-modal-selector'

class SampleApp extends Component {

Expand Down Expand Up @@ -43,16 +43,16 @@ class SampleApp extends Component {
<View style={{flex:1, justifyContent:'space-around', padding:50}}>

{ /* Default mode: a clickable button will re rendered */ }
<ModalPicker
<ModalSelector
data={data}
initValue="Select something yummy!"
onChange={(option)=>{ alert(`${option.label} (${option.key}) nom nom nom`) }}/>

{ /*
Wrapper mode: just wrap your existing component with ModalPicker.
Wrapper mode: just wrap your existing component with ModalSelector.
When the user clicks on your element, the modal selector is shown.
*/ }
<ModalPicker
<ModalSelector
data={data}
initValue="Select something yummy!"
onChange={(option)=>{ this.setState({textInputValue:option.label})}}>
Expand All @@ -63,10 +63,10 @@ class SampleApp extends Component {
placeholder="Select something yummy!"
value={this.state.textInputValue} />

</ModalPicker>
</ModalSelector>
</View>
);
}
}

export default SampleApp;
export default SampleApp;
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const defaultProps = {
keyboardShouldPersistTaps: 'always'
};

export default class ModalPicker extends BaseComponent {
export default class ModalSelector extends BaseComponent {

constructor() {

Expand Down Expand Up @@ -132,7 +132,7 @@ export default class ModalPicker extends BaseComponent {
});

return (
<View style={[styles.overlayStyle, this.props.overlayStyle]} key={'modalPicker'+(componentIndex++)}>
<View style={[styles.overlayStyle, this.props.overlayStyle]} key={'modalSelector'+(componentIndex++)}>
<View style={styles.optionContainer}>
<ScrollView keyboardShouldPersistTaps={this.props.keyboardShouldPersistTaps}>
<View style={{paddingHorizontal:10}}>
Expand Down Expand Up @@ -182,5 +182,5 @@ export default class ModalPicker extends BaseComponent {
}
}

ModalPicker.propTypes = propTypes;
ModalPicker.defaultProps = defaultProps;
ModalSelector.propTypes = propTypes;
ModalSelector.defaultProps = defaultProps;
14 changes: 9 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-modal-picker",
"version": "0.0.16",
"name": "react-native-modal-selector",
"version": "0.0.17",
"description": "",
"main": "index.js",
"scripts": {
Expand All @@ -9,7 +9,7 @@
},
"repository": {
"type": "git",
"url": "https://github.com/d-a-n/react-native-modal-picker.git"
"url": "https://github.com/peacechen/react-native-modal-selector.git"
},
"keywords": [
"react-native",
Expand All @@ -30,11 +30,15 @@
{
"name": "Alex Spring",
"email": "notlose@hotmail.com"
},
{
"name": "Peace Chen",
"url": "https://github.com/peacechen"
}
],
"license": "MIT",
"bugs": {
"url": "https://github.com/d-a-n/react-native-modal-picker/issues"
"url": "https://github.com/peacechen/react-native-modal-selector/issues"
},
"homepage": "https://github.com/d-a-n/react-native-modal-picker"
"homepage": "https://github.com/peacechen/react-native-modal-selector"
}

0 comments on commit 7fd3beb

Please sign in to comment.