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

rn-swipe-button

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rn-swipe-button - npm Package Compare versions

Comparing version 1.0.7 to 1.0.8

5

package.json
{
"name": "rn-swipe-button",
"version": "1.0.7",
"version": "1.0.8",
"description": "react native swipe/slide button component",

@@ -26,3 +26,4 @@ "main": "index.js",

"swipe-to-unlock",
"rn-slide-button"
"rn-slide-button",
"slide"
],

@@ -29,0 +30,0 @@ "author": "Uday Sravan Kumar Kamineni",

@@ -34,2 +34,3 @@ <h2 style="color:darkgreen;">React Native Swipe Button Component</h2>

<b>thumbIconBorderColor</b>: PropTypes.string,
<b>thumbIconComponent</b>: PropTypes.node,
<b>thumbIconImageSource</b>: PropTypes.oneOfType([

@@ -51,2 +52,3 @@ PropTypes.string,

import thumbIcon from './assets/thumbIcon.png';
import Icon from 'react-native-vector-icons/FontAwesome';

@@ -56,2 +58,3 @@ import SwipeButton from 'rn-swipe-button';

const App = () => {
const TwitterIcon = () => <Icon name="twitter" color="#3b5998" size={30} />;
return (

@@ -86,2 +89,10 @@ <View style={{padding: 15}}>

<SwipeButton height={35} width={150} title="Swipe" />
<Text style={{color: '#140866', fontSize: 20}}>
Pass component to set as thumb icon
</Text>
<SwipeButton
thumbIconBackgroundColor="#FFFFFF"
thumbIconComponent={TwitterIcon}
title="Slide to unlock"
/>
</View>

@@ -88,0 +99,0 @@ );

3

src/components/SwipeButton/index.js

@@ -98,2 +98,3 @@ import React from 'react';

thumbIconBorderColor,
thumbIconComponent,
thumbIconImageSource,

@@ -147,2 +148,3 @@ title,

thumbIconBorderColor={thumbIconBorderColor}
thumbIconComponent={thumbIconComponent}
thumbIconImageSource={thumbIconImageSource}

@@ -190,2 +192,3 @@ title={title}

thumbIconBorderColor: PropTypes.string,
thumbIconComponent: PropTypes.node,
thumbIconImageSource: PropTypes.oneOfType([

@@ -192,0 +195,0 @@ PropTypes.string,

@@ -71,3 +71,3 @@ import React from 'react';

}
if (this.props.onSwipeSuccess) this.props.onSwipeSuccess();
if (this.props.onSwipeSuccess) {this.props.onSwipeSuccess();}
this.reset();

@@ -77,3 +77,3 @@ }

onPanResponderMove(event, gestureState) {
if (this.props.disabled) return;
if (this.props.disabled) {return;}
const newWidth = this.defaultContainerWidth + gestureState.dx;

@@ -94,3 +94,3 @@ if (newWidth < this.defaultContainerWidth) {

onPanResponderRelease(event, gestureState) {
if (this.props.disabled) return;
if (this.props.disabled) {return;}
const newWidth = this.defaultContainerWidth + gestureState.dx;

@@ -123,3 +123,3 @@ const successThresholdWidth =

}).start(() => {
if (this.props.onSwipeSuccess) this.props.onSwipeSuccess();
if (this.props.onSwipeSuccess) {this.props.onSwipeSuccess();}
// this.reset(); // Enable this line to reset the thumb after successful swipe

@@ -147,2 +147,3 @@ });

thumbIconBorderColor,
thumbIconComponent: ThumbIconComponent,
thumbIconImageSource,

@@ -164,3 +165,10 @@ } = this.props;

<View style={[styles.icon, {...dynamicStyles}]}>
<Image resizeMethod="resize" source={thumbIconImageSource} />
{!ThumbIconComponent && (
<Image resizeMethod="resize" source={thumbIconImageSource} />
)}
{ThumbIconComponent && (
<View>
<ThumbIconComponent />
</View>
)}
</View>

@@ -220,2 +228,3 @@ );

thumbIconBorderColor: PropTypes.string,
thumbIconComponent: PropTypes.node,
thumbIconImageSource: PropTypes.oneOfType([

@@ -222,0 +231,0 @@ PropTypes.string,

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