react-native-raw-bottom-sheet
Advanced tools
Comparing version 1.1.4 to 2.0.0
{ | ||
"name": "react-native-raw-bottom-sheet", | ||
"version": "1.1.4", | ||
"version": "2.0.0", | ||
"description": "Add Your Own Component To Bottom Sheet Whatever You Want (Android & iOS)", | ||
"main": "index.js", | ||
"typings": "typings/index.d.ts", | ||
"scripts": { | ||
@@ -48,3 +49,3 @@ "test": "jest" | ||
"react-dom": "^16.8.3", | ||
"react-native": "^0.58.5" | ||
"react-native": "^0.59.3" | ||
}, | ||
@@ -51,0 +52,0 @@ "jest": { |
@@ -12,3 +12,3 @@ # react-native-raw-bottom-sheet | ||
- Customize Whatever You Like | ||
- Support Swipe Down Gesture | ||
- Support Drag Down Gesture | ||
- Support All Orientations | ||
@@ -45,12 +45,4 @@ - Support Both Android And iOS | ||
<View style={{ flex: 1, marginTop: 50, alignItems: "center" }}> | ||
<Button | ||
title="OPEN BOTTOM SHEET" | ||
onPress={() => { | ||
this.RBSheet.open(); | ||
}} | ||
/> | ||
<Button title="OPEN BOTTOM SHEET" onPress={() => RBSheet.open()} /> | ||
<RBSheet | ||
ref={ref => { | ||
this.RBSheet = ref; | ||
}} | ||
height={300} | ||
@@ -79,3 +71,3 @@ duration={250} | ||
| Prop | Type | Description | Default | | ||
| Props | Type | Description | Default | | ||
| ---------------- | -------- | ---------------------------------------------- | -------- | | ||
@@ -86,3 +78,3 @@ | animationType | string | Background animation ("none", "fade", "slide") | "none" | | ||
| duration | number | Duration of Bottom Sheet animation | 300 (ms) | | ||
| closeOnSwipeDown | boolean | Use gesture swipe down to close Bottom Sheet | false | | ||
| closeOnDragDown | boolean | Use gesture drag down to close Bottom Sheet | false | | ||
| closeOnPressMask | boolean | Press the area outside to close Bottom Sheet | true | | ||
@@ -110,4 +102,4 @@ | onClose | function | Callback function when Bottom Sheet has closed | | | ||
- Always set `ref` to `RBSheet` and call each method by using `this.RBSheet.methodName()` like example above. | ||
- If you want to use `Scrollable Component` like `ScrollView`, `Flatlist` or something else inside `RBSheet`, you have to change prop `closeOnSwipeDown` to `false` otherwise it won't work. | ||
- Call each method by using `RBSheet.methodName()` like example above. | ||
- If you want to use `Scrollable Component` like `ScrollView`, `FlatList` or something else inside `RBSheet`, you have to change props `closeOnDragDown` to `false` otherwise it won't work. | ||
@@ -114,0 +106,0 @@ ## Give me a Star |
@@ -52,6 +52,6 @@ import React, { Component } from "react"; | ||
createPanResponder(props) { | ||
const { closeOnSwipeDown, height } = props; | ||
const { closeOnDragDown, height } = props; | ||
const { pan } = this.state; | ||
this.panResponder = PanResponder.create({ | ||
onStartShouldSetPanResponder: () => closeOnSwipeDown, | ||
onStartShouldSetPanResponder: () => closeOnDragDown, | ||
onPanResponderMove: (e, gestureState) => { | ||
@@ -120,3 +120,3 @@ if (gestureState.dy > 0) { | ||
duration: PropTypes.number, | ||
closeOnSwipeDown: PropTypes.bool, | ||
closeOnDragDown: PropTypes.bool, | ||
closeOnPressMask: PropTypes.bool, | ||
@@ -133,3 +133,3 @@ customStyles: PropTypes.objectOf(PropTypes.object), | ||
duration: 300, | ||
closeOnSwipeDown: false, | ||
closeOnDragDown: false, | ||
closeOnPressMask: true, | ||
@@ -136,0 +136,0 @@ customStyles: {}, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16788
12
291
112