New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

codepin

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

codepin

this is a react-native component for a implements a code pin view in your project.

latest
Source
npmnpm
Version
0.0.6
Version published
Maintainers
1
Created
Source

react-native-code-pin

License npm Version npm Downloads
This is a react-native component for a implements a code pin view in your project

Attention: This package is under development and evolution over time
Contributions are welcome!

PinCodePinCode2 PinCode3

Installation

npm install --save pincode

or

yarn add pincode

Basic Usage

Basic usage requires Code and Size.

  • Size : requires the size of the code
import PinCode from 'pincode'

<PinCode Size={4} />

Options

KeyDescriptionRequiredDefaultType
ForgetTextChange the text of the forget methodfalseforgetstring
ForgetMethodtake as a parameter a function to execute when forget is calledfalse() => (console.log('forget')func
Sizeis a size of the codetrue4number
Randomreturn the keyboard keys randomlyfalsefalseboolean
eventCodeis a function that takes in parameter the password typed by the user, a error function and a loading function???(event, error, loading) => {}func

Example

basic use of eventCode prop

...
import PinCode from 'pincode'

export default Example extends Component {
  ...
  checkCode = (event, loading, error) => {
    if(event == 'this.state.YourCode'){
      loading(true);
      setTimeout(() => {
          loading(false)
      }, 5000);
    } else {
      error();
    }
  }
  
  render(){
    return (
        <View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}> 
          <PinCode Size={4} eventCode={this.checkCode}/>
        </View>
    )
  }
}

Utilisation

  • eventCode(event, error, loading)
  • event() return the code entered by the user
  • error() clear the animation
  • loading(value) stop the loading animation value by default egal false

Styles

KeyDescriptionDefaultType
TextColorchange color of the keyboard text'#5262F3'string
BorderColorchange color of the Keyboard border'rgba(0,0,0,0.1)'string
PinColorChange color of the pin codeturquoisestring
FontSizesets the font size30number
CodeColoris an array of the different colors of the animation['#EB5088', '#72C1FA', '#F5D679', '#76ECC9', '#5468F3', 'red']arrayOf(string)
ImageSizesize of the icon{height: 15, width:20}object(height, width)
ImageLocationlink to the iconrequire('./assets/icons/backspace-arrow.png')any

Keywords

react-native

FAQs

Package last updated on 11 Dec 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts