1.0.1 • Published 3 years ago

rn-otp-timer v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

rn-otp-timer

A standalone , fully customizable Otp timer you can easily use.

Installation

npm install rn-otp-timer

Usage

import RnOtpTimer from 'rn-otp-timer';

<RnOtpTimer
  minutes={0}
  seconds={40}
  resendButtonStyle={styles.button}
  resendButtonTextStyle={styles.buttonText}
  resendButtonAction={() => {
    console.log('otp resent!');
  }}
/>;

Parameters

ParameterRequiredDescription
minutesNoNumber of minutes for which the timer must be set
secondsNoNumber of seconds for which the timer must be set
resendButtonTextNoSet resend button text content
resendButtonActionYesCallback when resend button is clicked
timerStyleNoProps for styling timer content
resendButtonStyleYesProps for styling resend button
resendButtonTextStyleYesProps for styling resend button text

Development workflow

To get started with the project, run yarn in the root directory to install the required dependencies for each package:

yarn

While it's possible to use npm, the tooling is built around yarn, so you'll have an easier time if you use yarn for development.

While developing, you can run the example app to test your changes.

To run the example app on Android, go to example app directory and run:

yarn android

Contributing

Pull requests are welcome . For major changes, please open an issue first to discuss what you would like to change.

License

MIT

Credits

react-native-bob-builder