Skip to content

Commit 41d5af5

Browse files
committed
feat: You can click bottom sheets away by pressing the backdrop
1 parent 0065246 commit 41d5af5

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

app/modules/BottomSheetManager/BottomSheetProvider.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react'
2-
import { StyleSheet, View } from 'react-native'
2+
import { StyleSheet, View, TouchableWithoutFeedback } from 'react-native'
33
import BottomSheet from 'reanimated-bottom-sheet'
44
import ReAnimated from 'react-native-reanimated'
55

@@ -109,7 +109,10 @@ export const BottomSheetProvider = ({ children }) => {
109109
outputRange: [0.8, 0],
110110
}),
111111
}}>
112-
<View style={[styles.overlayContainer, styles.overlay]} />
112+
113+
<TouchableWithoutFeedback onPress={closeBottomSheet}>
114+
<View style={[styles.overlayContainer, styles.overlay]} />
115+
</TouchableWithoutFeedback>
113116
</ReAnimated.View>
114117

115118
<BottomSheet

package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
"test:watch": "yarn test --watch"
2727
},
2828
"resolutions": {
29-
"react-native-gesture-handler": "1.8.0"
29+
"react-native-gesture-handler": "1.8.0",
30+
"react-native-reanimated": "1.13.0"
3031
},
3132
"dependencies": {
3233
"@apollo/client": "^3.3.2",
@@ -55,7 +56,7 @@
5556
"react-native-linear-gradient": "2.5.6",
5657
"react-native-markdown-renderer": "^3.2.8",
5758
"react-native-orientation": "^3.1.3",
58-
"react-native-reanimated": "1.13.2",
59+
"react-native-reanimated": "1.13.0",
5960
"react-native-safe-area-context": "3.1.9",
6061
"react-native-screens": "2.15.0",
6162
"react-native-splash-screen": "3.2.0",

yarn.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -7818,10 +7818,10 @@ react-native-orientation@^3.1.3:
78187818
resolved "https://registry.yarnpkg.com/react-native-orientation/-/react-native-orientation-3.1.3.tgz#d45803841fe94b6cce9acbe904fd5ca191a3711e"
78197819
integrity sha512-A0h0E+2f95X4avmhaBG1ZT8WDxBACA/q//JN2eF1E7kq8AJVxt5XDiavv+aSBkBlqFsfF3bIS+T/DB5mXmnxuA==
78207820

7821-
7822-
version "1.13.2"
7823-
resolved "https://registry.yarnpkg.com/react-native-reanimated/-/react-native-reanimated-1.13.2.tgz#1ae5457b24b4913d173a5a064bb28eae7783d293"
7824-
integrity sha512-O+WhgxSjOIzcVdAAvx+h2DY331Ek1knKlaq+jsNLpC1fhRy9XTdOObovgob/aF2ve9uJfPEawCx8381g/tUJZQ==
7821+
7822+
version "1.13.0"
7823+
resolved "https://registry.yarnpkg.com/react-native-reanimated/-/react-native-reanimated-1.13.0.tgz#1ee5d27d34bd2cee7dfad4ae9a3673300872c917"
7824+
integrity sha512-uadP/0QO+4TCsyPSvzRdl+76NPM7Bp8M25KQLB4Hg3tWBMjhrMrETnzNi33L/OPfmhU+7rceyi0QPe/DxKT5bQ==
78257825
dependencies:
78267826
fbjs "^1.0.0"
78277827

0 commit comments

Comments
 (0)