Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-swipe-verify

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-swipe-verify

RNSwipeVerify =========

  • 0.0.9
  • npm
  • Socket score

Version published
Weekly downloads
197
increased by64.17%
Maintainers
1
Weekly downloads
 
Created
Source

RNSwipeVerify

A small componenent to Swipe Verify

Installation

npm install --save react-native-swipe-verify

Preview

lolo

Important

If the RNSwipeVerify is inside another component with PanResponder the RNSwipeVerify will be cancelled.

Usage

import React, { Component } from 'react';

import {
  View,
  TouchableOpacity, Text,
  Dimensions
} from 'react-native';


const { width } = Dimensions.get('window')

import RNSwipeVerify from 'react-native-swipe-verify'

export default class App extends Component {

  constructor(props) {
    super(props)

    this.state = {
      verify: false
    }

  }

  render() {

    const { verify } = this.state
    return (
      <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>


        <RNSwipeVerify 
          ref={ref => this.swipeVerify = ref} 
          puzzleSize={60} 
          width={width - 40} 
          onVerify={verify => this.setState({ verify })}
          text={verify ? "VERIFIED" : "Slide to verify"} 
          puzzleColor="#01579B" 
          borderColor={verify ? '#1DE9B6' : '#01579B'}
          textColor={verify ? '#1DE9B6' : '#01579B'} 
          backgroundColor="#fff"
          icon={require('../img/swipe.png')}      
        />


        {this.state.verify && (<TouchableOpacity onPress={() => this.swipeVerify.reset(false)} style={{ marginTop: 30 }}>
          <Text style={{ padding: 10, color: '#0091EA', fontSize: 25 }}>RESET</Text>
        </TouchableOpacity>)}

      </View>
    );
  }
}

Props

nametypedefaultdescription
width (required)numberrequiredthe width of swipe-verify
puzzleSize (required)numberrequiredthe puzzle (Icon) size of swipe-verify
backgroundColor (optional)string#F50057background color
puzzleColor (optional)string#D50000puzzle background color
icon (optional)imagearrow iconimage to puzzle (only .png or .jpg).
You can use icon={require('../img/swipe.png')} or icon={{ uri: 'http://images.com/swipe-icon.jpg'}}
text (optional)string#D50000text to show
textColor (optional)string#FFFFFFtext color
borderColor (optional)string#D50000border color

Callbacks

nameargumentsnotes
onVerify (required)boollistener to check if the swipe is verified (user has completed swipe)

Methods

nameargumentsnotes
reset(bool) (required)bool (animate)reset the swipe-verify to default values

Keywords

FAQs

Package last updated on 22 Nov 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc