diff --git a/examples/App.tsx b/examples/App.tsx index 458b94f..9113b41 100644 --- a/examples/App.tsx +++ b/examples/App.tsx @@ -7,7 +7,7 @@ */ import React, {Component} from 'react'; -import {StyleSheet, StatusBar, Text} from 'react-native'; +import {StyleSheet, StatusBar} from 'react-native'; import {SafeAreaView} from 'react-navigation'; import {Header} from './components/Header'; @@ -23,18 +23,18 @@ import {SwipeablePanel} from 'rn-swipeable-panel'; export type AppState = { content: Function; - isActive: Boolean; - openLarge: Boolean; - onlyLarge: Boolean; - fullWidth: Boolean; - noBar: Boolean; + isActive: boolean; + openLarge: boolean; + onlyLarge: boolean; + fullWidth: boolean; + noBar: boolean; barStyle: Object; - showCloseButton: Boolean; - noBackgroundOpacity: Boolean; - bounceAnimation: Boolean; - closeOnTouchOutside: Boolean; - onlySmall: Boolean; - allowTouchOutside: Boolean; + showCloseButton: boolean; + noBackgroundOpacity: boolean; + bounceAnimation: boolean; + closeOnTouchOutside: boolean; + onlySmall: boolean; + allowTouchOutside: boolean; panelStyles: Object; }; diff --git a/examples/components/Panel/Panel.tsx b/examples/components/Panel/Panel.tsx index ad38c80..30f8906 100644 --- a/examples/components/Panel/Panel.tsx +++ b/examples/components/Panel/Panel.tsx @@ -8,6 +8,7 @@ import { Animated, Dimensions, PanResponder, + ScrollViewProps, } from 'react-native'; import {Bar} from './Bar'; @@ -39,6 +40,7 @@ type SwipeablePanelProps = { noBar?: boolean; barStyle?: object; allowTouchOutside?: boolean; + scrollViewProps?: ScrollViewProps; }; type MaybeAnimated = T | Animated.Value; @@ -298,7 +300,8 @@ class SwipeablePanel extends Component< }} contentContainerStyle={ SwipeablePanelStyles.scrollViewContentContainerStyle - }> + } + {...this.props.scrollViewProps}> {this.state.canScroll ? ( {this.props.children} diff --git a/examples/package.json b/examples/package.json index 2eb27b7..2499b83 100644 --- a/examples/package.json +++ b/examples/package.json @@ -21,14 +21,13 @@ "react-native-typography": "^1.4.1", "react-native-vector-icons": "^6.6.0", "react-navigation": "^3.11.0", - "rn-swipeable-panel": "../rn-swipeable-panel-1.2.3.tgz" + "rn-swipeable-panel": "../rn-swipeable-panel-v1.2.5.tgz" }, "devDependencies": { "@babel/core": "^7.7.7", "@babel/plugin-transform-runtime": "^7.1.0", "@babel/runtime": "^7.6.2", "@react-native-community/eslint-config": "^0.0.5", - "@types/rn-swipeable-panel": "^1.1.0", "babel-jest": "^24.9.0", "babel-plugin-module-resolver": "^3.1.1", "babel-plugin-transform-remove-console": "^6.9.4", diff --git a/examples/yarn.lock b/examples/yarn.lock index 8240681..89cc110 100644 --- a/examples/yarn.lock +++ b/examples/yarn.lock @@ -1231,13 +1231,6 @@ "@types/prop-types" "*" csstype "^3.0.2" -"@types/rn-swipeable-panel@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@types/rn-swipeable-panel/-/rn-swipeable-panel-1.1.0.tgz#315814817e93ee45494b48d9e86ab59b1d726664" - integrity sha512-gsYQ4I+HECNlfeITQgxAkXgRLtW9xCbSFzDw3IhN0rIUmhbmGY2+YKMTWYiobJ6hMUhEoh64WKeen1JWvb7Y2w== - dependencies: - "@types/react" "*" - "@types/stack-utils@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e" @@ -6079,9 +6072,16 @@ rimraf@~2.2.6: resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.2.8.tgz#e439be2aaee327321952730f99a8929e4fc50582" integrity sha1-5Dm+Kq7jJzIZUnMPmaiSnk/FBYI= -rn-swipeable-panel@../rn-swipeable-panel-1.2.3.tgz: +rn-swipeable-panel@../rn-swipeable-panel-v1.2.5.tgz: + version "1.2.5" + resolved "../rn-swipeable-panel-v1.2.5.tgz#89cea26635327444d1af7d81af76ed6e31662308" + dependencies: + rn-swipeable-panel "^1.2.3" + +rn-swipeable-panel@^1.2.3: version "1.2.3" - resolved "../rn-swipeable-panel-1.2.3.tgz#c2aac0b10bfdc00dd92eca3f5e78995761c39a04" + resolved "https://registry.yarnpkg.com/rn-swipeable-panel/-/rn-swipeable-panel-1.2.3.tgz#c2aac0b10bfdc00dd92eca3f5e78995761c39a04" + integrity sha512-pq2NDXHq0U4iqqhLsPxKdeshjSNgU6snOn/99bF4xhLA8UWZjTCDAhRo723W+YsSQY28/VMdiQv0XOtZgXQOAQ== rsvp@^4.8.4: version "4.8.4" diff --git a/package.json b/package.json index 35c708b..2de295d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rn-swipeable-panel", - "version": "1.2.3", + "version": "1.2.5", "description": "Swipeable bottom panel for react native", "author": "Enes Ozturk", "license": "MIT", @@ -10,7 +10,13 @@ }, "main": "dist/index.js", "module": "dist/index.modern.js", - "source": "src/index.tsx", + "types": "dist/index.d.ts", + "source": "src/index.ts", + "files": [ + "dist", + "src" + ], + "react-native": "src/index.ts", "engines": { "node": ">=10" }, @@ -92,7 +98,7 @@ "react-scripts": "^3.4.1", "typescript": "^3.7.5" }, - "files": [ - "dist" - ] + "dependencies": { + "rn-swipeable-panel": "^1.2.3" + } } diff --git a/rn-swipeable-panel-1.2.3.tgz b/rn-swipeable-panel-1.2.3.tgz deleted file mode 100644 index 9372233..0000000 Binary files a/rn-swipeable-panel-1.2.3.tgz and /dev/null differ diff --git a/rn-swipeable-panel-v1.2.5.tgz b/rn-swipeable-panel-v1.2.5.tgz new file mode 100644 index 0000000..0895fdf Binary files /dev/null and b/rn-swipeable-panel-v1.2.5.tgz differ diff --git a/src/Panel.tsx b/src/Panel.tsx index 59d446f..2b61ecf 100644 --- a/src/Panel.tsx +++ b/src/Panel.tsx @@ -8,7 +8,7 @@ import { Animated, Dimensions, PanResponder, - ScrollViewProps + ScrollViewProps, } from 'react-native'; import { Bar } from './Bar'; @@ -40,7 +40,7 @@ type SwipeablePanelProps = { noBar?: boolean; barStyle?: object; allowTouchOutside?: boolean; - scrollViewProps?:ScrollViewProps + scrollViewProps?: ScrollViewProps; }; type MaybeAnimated = T | Animated.Value; @@ -252,7 +252,6 @@ class SwipeablePanel extends Component )} { return false; }} diff --git a/src/index.tsx b/src/index.ts similarity index 100% rename from src/index.tsx rename to src/index.ts diff --git a/src/typings.d.ts b/src/typings.d.ts index 50e056a..1340f70 100644 --- a/src/typings.d.ts +++ b/src/typings.d.ts @@ -4,6 +4,7 @@ // Definitions: https://github.com/DefinitelyTyped/types/rn-swipeable-panel import * as React from 'react'; +import { ScrollViewProps } from 'react-native'; declare interface SwipeablePanelProps extends React.Props { /** @@ -82,6 +83,11 @@ declare interface SwipeablePanelProps extends React.Props { * Required prop to keep panel's state sync with your parent components'state. Will be fired when panel is closed. See the example project. */ onClose: () => void; + + /** + * You can pass your scroll view props + */ + scrollViewProps?: ScrollViewProps; } declare var LARGE_PANEL_CONTENT_HEIGHT: number; diff --git a/yarn.lock b/yarn.lock index 870bcf3..9ac39ed 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9988,6 +9988,11 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: hash-base "^3.0.0" inherits "^2.0.1" +rn-swipeable-panel@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/rn-swipeable-panel/-/rn-swipeable-panel-1.2.3.tgz#c2aac0b10bfdc00dd92eca3f5e78995761c39a04" + integrity sha512-pq2NDXHq0U4iqqhLsPxKdeshjSNgU6snOn/99bF4xhLA8UWZjTCDAhRo723W+YsSQY28/VMdiQv0XOtZgXQOAQ== + rollup-plugin-babel@^4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/rollup-plugin-babel/-/rollup-plugin-babel-4.4.0.tgz#d15bd259466a9d1accbdb2fe2fff17c52d030acb"