Skip to content

Commit 687eaf7

Browse files
committed
Update example app and create new pack
1 parent 62d65c6 commit 687eaf7

File tree

11 files changed

+50
-32
lines changed

11 files changed

+50
-32
lines changed

examples/App.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88

99
import React, {Component} from 'react';
10-
import {StyleSheet, StatusBar, Text} from 'react-native';
10+
import {StyleSheet, StatusBar} from 'react-native';
1111
import {SafeAreaView} from 'react-navigation';
1212

1313
import {Header} from './components/Header';
@@ -23,18 +23,18 @@ import {SwipeablePanel} from 'rn-swipeable-panel';
2323

2424
export type AppState = {
2525
content: Function;
26-
isActive: Boolean;
27-
openLarge: Boolean;
28-
onlyLarge: Boolean;
29-
fullWidth: Boolean;
30-
noBar: Boolean;
26+
isActive: boolean;
27+
openLarge: boolean;
28+
onlyLarge: boolean;
29+
fullWidth: boolean;
30+
noBar: boolean;
3131
barStyle: Object;
32-
showCloseButton: Boolean;
33-
noBackgroundOpacity: Boolean;
34-
bounceAnimation: Boolean;
35-
closeOnTouchOutside: Boolean;
36-
onlySmall: Boolean;
37-
allowTouchOutside: Boolean;
32+
showCloseButton: boolean;
33+
noBackgroundOpacity: boolean;
34+
bounceAnimation: boolean;
35+
closeOnTouchOutside: boolean;
36+
onlySmall: boolean;
37+
allowTouchOutside: boolean;
3838
panelStyles: Object;
3939
};
4040

examples/components/Panel/Panel.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
Animated,
99
Dimensions,
1010
PanResponder,
11+
ScrollViewProps,
1112
} from 'react-native';
1213

1314
import {Bar} from './Bar';
@@ -39,6 +40,7 @@ type SwipeablePanelProps = {
3940
noBar?: boolean;
4041
barStyle?: object;
4142
allowTouchOutside?: boolean;
43+
scrollViewProps?: ScrollViewProps;
4244
};
4345

4446
type MaybeAnimated<T> = T | Animated.Value;
@@ -298,7 +300,8 @@ class SwipeablePanel extends Component<
298300
}}
299301
contentContainerStyle={
300302
SwipeablePanelStyles.scrollViewContentContainerStyle
301-
}>
303+
}
304+
{...this.props.scrollViewProps}>
302305
{this.state.canScroll ? (
303306
<TouchableHighlight>
304307
<React.Fragment>{this.props.children}</React.Fragment>

examples/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,13 @@
2121
"react-native-typography": "^1.4.1",
2222
"react-native-vector-icons": "^6.6.0",
2323
"react-navigation": "^3.11.0",
24-
"rn-swipeable-panel": "../rn-swipeable-panel-1.2.3.tgz"
24+
"rn-swipeable-panel": "../rn-swipeable-panel-v1.2.5.tgz"
2525
},
2626
"devDependencies": {
2727
"@babel/core": "^7.7.7",
2828
"@babel/plugin-transform-runtime": "^7.1.0",
2929
"@babel/runtime": "^7.6.2",
3030
"@react-native-community/eslint-config": "^0.0.5",
31-
"@types/rn-swipeable-panel": "^1.1.0",
3231
"babel-jest": "^24.9.0",
3332
"babel-plugin-module-resolver": "^3.1.1",
3433
"babel-plugin-transform-remove-console": "^6.9.4",

examples/yarn.lock

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,13 +1231,6 @@
12311231
"@types/prop-types" "*"
12321232
csstype "^3.0.2"
12331233

1234-
"@types/rn-swipeable-panel@^1.1.0":
1235-
version "1.1.0"
1236-
resolved "https://registry.yarnpkg.com/@types/rn-swipeable-panel/-/rn-swipeable-panel-1.1.0.tgz#315814817e93ee45494b48d9e86ab59b1d726664"
1237-
integrity sha512-gsYQ4I+HECNlfeITQgxAkXgRLtW9xCbSFzDw3IhN0rIUmhbmGY2+YKMTWYiobJ6hMUhEoh64WKeen1JWvb7Y2w==
1238-
dependencies:
1239-
"@types/react" "*"
1240-
12411234
"@types/stack-utils@^1.0.1":
12421235
version "1.0.1"
12431236
resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e"
@@ -6079,9 +6072,16 @@ rimraf@~2.2.6:
60796072
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.2.8.tgz#e439be2aaee327321952730f99a8929e4fc50582"
60806073
integrity sha1-5Dm+Kq7jJzIZUnMPmaiSnk/FBYI=
60816074

6082-
rn-swipeable-panel@../rn-swipeable-panel-1.2.3.tgz:
6075+
rn-swipeable-panel@../rn-swipeable-panel-v1.2.5.tgz:
6076+
version "1.2.5"
6077+
resolved "../rn-swipeable-panel-v1.2.5.tgz#89cea26635327444d1af7d81af76ed6e31662308"
6078+
dependencies:
6079+
rn-swipeable-panel "^1.2.3"
6080+
6081+
rn-swipeable-panel@^1.2.3:
60836082
version "1.2.3"
6084-
resolved "../rn-swipeable-panel-1.2.3.tgz#c2aac0b10bfdc00dd92eca3f5e78995761c39a04"
6083+
resolved "https://registry.yarnpkg.com/rn-swipeable-panel/-/rn-swipeable-panel-1.2.3.tgz#c2aac0b10bfdc00dd92eca3f5e78995761c39a04"
6084+
integrity sha512-pq2NDXHq0U4iqqhLsPxKdeshjSNgU6snOn/99bF4xhLA8UWZjTCDAhRo723W+YsSQY28/VMdiQv0XOtZgXQOAQ==
60856085

60866086
rsvp@^4.8.4:
60876087
version "4.8.4"

package.json

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rn-swipeable-panel",
3-
"version": "1.2.3",
3+
"version": "1.2.5",
44
"description": "Swipeable bottom panel for react native",
55
"author": "Enes Ozturk",
66
"license": "MIT",
@@ -10,7 +10,13 @@
1010
},
1111
"main": "dist/index.js",
1212
"module": "dist/index.modern.js",
13-
"source": "src/index.tsx",
13+
"types": "dist/index.d.ts",
14+
"source": "src/index.ts",
15+
"files": [
16+
"dist",
17+
"src"
18+
],
19+
"react-native": "src/index.ts",
1420
"engines": {
1521
"node": ">=10"
1622
},
@@ -92,7 +98,7 @@
9298
"react-scripts": "^3.4.1",
9399
"typescript": "^3.7.5"
94100
},
95-
"files": [
96-
"dist"
97-
]
101+
"dependencies": {
102+
"rn-swipeable-panel": "^1.2.3"
103+
}
98104
}

rn-swipeable-panel-1.2.3.tgz

-13.5 KB
Binary file not shown.

rn-swipeable-panel-v1.2.5.tgz

23.5 KB
Binary file not shown.

src/Panel.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
Animated,
99
Dimensions,
1010
PanResponder,
11-
ScrollViewProps
11+
ScrollViewProps,
1212
} from 'react-native';
1313

1414
import { Bar } from './Bar';
@@ -40,7 +40,7 @@ type SwipeablePanelProps = {
4040
noBar?: boolean;
4141
barStyle?: object;
4242
allowTouchOutside?: boolean;
43-
scrollViewProps?:ScrollViewProps
43+
scrollViewProps?: ScrollViewProps;
4444
};
4545

4646
type MaybeAnimated<T> = T | Animated.Value;
@@ -252,7 +252,6 @@ class SwipeablePanel extends Component<SwipeablePanelProps, SwipeablePanelState>
252252
<Close rootStyle={closeRootStyle} iconStyle={closeIconStyle} onPress={this.props.onClose} />
253253
)}
254254
<ScrollView
255-
256255
onTouchStart={() => {
257256
return false;
258257
}}
File renamed without changes.

src/typings.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
// Definitions: https://github.com/DefinitelyTyped/types/rn-swipeable-panel
55

66
import * as React from 'react';
7+
import { ScrollViewProps } from 'react-native';
78

89
declare interface SwipeablePanelProps extends React.Props<SwipeablePanel> {
910
/**
@@ -82,6 +83,11 @@ declare interface SwipeablePanelProps extends React.Props<SwipeablePanel> {
8283
* Required prop to keep panel's state sync with your parent components'state. Will be fired when panel is closed. See the example project.
8384
*/
8485
onClose: () => void;
86+
87+
/**
88+
* You can pass your scroll view props
89+
*/
90+
scrollViewProps?: ScrollViewProps;
8591
}
8692

8793
declare var LARGE_PANEL_CONTENT_HEIGHT: number;

0 commit comments

Comments
 (0)