Skip to content

Commit

Permalink
Version 1.1.0 and readme update
Browse files Browse the repository at this point in the history
  • Loading branch information
ansonyao committed Aug 19, 2019
1 parent 62202c3 commit d15e349
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@ import OTPInputView from '@twotalltotems/react-native-otp-input'
<OTPInputView
style={{width: '80%', height: 200}}
pinCount={4}
code=""
autoFocusOnLoad={true}
// codeInputFieldStyle={styles.borderStyleBase}
// codeInputHighlightStyle={styles.borderStyleHighLighted}
// code={this.state.code} //You can supply this prop or not. The component will be used as a controlled / uncontrolled component respectively.
// onCodeChanged = {code => { this.setState({code})}}
autoFocusOnLoad
codeInputFieldStyle={styles.underlineStyleBase}
codeInputHighlightStyle={styles.underlineStyleHighLighted}
onCodeFilled = {(code => {
Expand Down Expand Up @@ -62,10 +61,11 @@ const styles = StyleSheet.create({
| Parameter | required | Description |
|-------------|----------|-------------|
| pinCount | YES | Number of digits in the component |
| code | NO | You can use this to override whatever user has typed. For example, you can use it to hook up with the Android SMS Retriever API. You should rarely need to use this one. But if you really need to, use it along with the key prop. Check our example app. |
| code | NO | You can use this library as a controlled / uncontrolled component by supplying this prop or not |
| codeInputFieldStyle | NO | The style of the input field which is NOT focused |
| codeInputHighlightStyle | NO | The style of the input field which is focused |
| autoFocusOnLoad | NO | Auto activate the input and bring up the keyboard when component is loaded |
| onCodeChanged | NO | Callback when the digits are changed |
| onCodeFilled | NO | Callback when the last digit is entered |

## Notes
Expand Down
6 changes: 3 additions & 3 deletions example/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ export default class App extends React.Component {
<OTPInputView
style={{width: '80%', height: 200}}
pinCount={4}
code={this.state.code}
onCodeChanged = {code => { this.setState({code})}}
autoFocusOnLoad={true}
// code={this.state.code} //You can supply this prop or not. The component will be used as a controlled / uncontrolled component respectively.
// onCodeChanged = {code => { this.setState({code})}}
autoFocusOnLoad
codeInputFieldStyle={styles.underlineStyleBase}
codeInputHighlightStyle={styles.underlineStyleHighLighted}
onCodeFilled = {(code => {
Expand Down
2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"test": "jest"
},
"dependencies": {
"@twotalltotems/react-native-otp-input": "^1.0.22",
"@twotalltotems/react-native-otp-input": "^1.1.0",
"react": "16.6.3",
"react-native": "0.58.4"
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@twotalltotems/react-native-otp-input",
"version": "1.0.23",
"version": "1.1.0",
"description": "is a tiny JS library for one time passcode (OTP). Supports smart input suggestion on iOS and code autofill on Android (it will be filled when you press the copy button on the SMS notification bar)",
"main": "index.js",
"directories": {
Expand Down

0 comments on commit d15e349

Please sign in to comment.