Skip to content

Commit

Permalink
Update example app and create new pack
Browse files Browse the repository at this point in the history
  • Loading branch information
enesozturk committed Dec 27, 2020
1 parent 62d65c6 commit 687eaf7
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 32 deletions.
24 changes: 12 additions & 12 deletions examples/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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;
};

Expand Down
5 changes: 4 additions & 1 deletion examples/components/Panel/Panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
Animated,
Dimensions,
PanResponder,
ScrollViewProps,
} from 'react-native';

import {Bar} from './Bar';
Expand Down Expand Up @@ -39,6 +40,7 @@ type SwipeablePanelProps = {
noBar?: boolean;
barStyle?: object;
allowTouchOutside?: boolean;
scrollViewProps?: ScrollViewProps;
};

type MaybeAnimated<T> = T | Animated.Value;
Expand Down Expand Up @@ -298,7 +300,8 @@ class SwipeablePanel extends Component<
}}
contentContainerStyle={
SwipeablePanelStyles.scrollViewContentContainerStyle
}>
}
{...this.props.scrollViewProps}>
{this.state.canScroll ? (
<TouchableHighlight>
<React.Fragment>{this.props.children}</React.Fragment>
Expand Down
3 changes: 1 addition & 2 deletions examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
18 changes: 9 additions & 9 deletions examples/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
16 changes: 11 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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"
},
Expand Down Expand Up @@ -92,7 +98,7 @@
"react-scripts": "^3.4.1",
"typescript": "^3.7.5"
},
"files": [
"dist"
]
"dependencies": {
"rn-swipeable-panel": "^1.2.3"
}
}
Binary file removed rn-swipeable-panel-1.2.3.tgz
Binary file not shown.
Binary file added rn-swipeable-panel-v1.2.5.tgz
Binary file not shown.
5 changes: 2 additions & 3 deletions src/Panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
Animated,
Dimensions,
PanResponder,
ScrollViewProps
ScrollViewProps,
} from 'react-native';

import { Bar } from './Bar';
Expand Down Expand Up @@ -40,7 +40,7 @@ type SwipeablePanelProps = {
noBar?: boolean;
barStyle?: object;
allowTouchOutside?: boolean;
scrollViewProps?:ScrollViewProps
scrollViewProps?: ScrollViewProps;
};

type MaybeAnimated<T> = T | Animated.Value;
Expand Down Expand Up @@ -252,7 +252,6 @@ class SwipeablePanel extends Component<SwipeablePanelProps, SwipeablePanelState>
<Close rootStyle={closeRootStyle} iconStyle={closeIconStyle} onPress={this.props.onClose} />
)}
<ScrollView

onTouchStart={() => {
return false;
}}
Expand Down
File renamed without changes.
6 changes: 6 additions & 0 deletions src/typings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<SwipeablePanel> {
/**
Expand Down Expand Up @@ -82,6 +83,11 @@ declare interface SwipeablePanelProps extends React.Props<SwipeablePanel> {
* 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;
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 687eaf7

Please sign in to comment.