Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copyright and Usage Example #11

Closed
neutrous opened this issue Jul 10, 2018 · 2 comments
Closed

Copyright and Usage Example #11

neutrous opened this issue Jul 10, 2018 · 2 comments

Comments

@neutrous
Copy link

First, thanks for your great PinCode component, it looks fantastic 👍.
However, owing to the lack of a copyright statement, it makes me stop the pace to use it in a potential commercial product.
If that not be a problem, would you please give a simple Example of how to use this component? Suppose using this component in a single screen, combined with react-navigation, how could I navigate to another screen after successfully PIN CODE input?

@jeremy-farnault
Copy link
Contributor

jeremy-farnault commented Jul 11, 2018

Hi!

I added the licence, sorry for that :). Feel free to use it anyway you want.
To navigate to a new page after a successful input, you can use the finishProcess props.
So on a basic usage it could look like this:

    return (
      <View style={styles.container}>
        <PINCode
          status={'enter'}
          finishProcess={() => this.props.navigation.navigate('someNewPage')}/>
      </View>
    )

As the navigation to the new page is triggered on the last digit press, you could add a small delay to have something less ugly :).

 return (
      <View style={styles.container}>
        <PINCode
          status={'enter'}
          finishProcess={async () => {
            await delay(500)
            this.props.navigation.navigate('someNewPage')
          }}/>
      </View>
    )

Cheers

@neutrous
Copy link
Author

Thanks for your quick reply 😎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants