react-native-boxes 1.4.9 → 1.4.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/Modal.tsx +20 -12
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-boxes",
3
- "version": "1.4.9",
3
+ "version": "1.4.10",
4
4
  "description": "A react native library for rapid development of UI using boxes",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/Modal.tsx CHANGED
@@ -21,6 +21,7 @@ export type BottomSheetProps = {
21
21
  onDismiss?: Function
22
22
  backgroundColor?: string
23
23
  closeIcon?: string | React.ReactNode
24
+ swipeToCloseDisabled?: boolean
24
25
 
25
26
  }
26
27
  export const BottomSheet = (props: BottomSheetProps) => {
@@ -44,7 +45,7 @@ export const BottomSheet = (props: BottomSheetProps) => {
44
45
  return (<Icon color={theme.colors.caption} name="close" />)
45
46
  })
46
47
  const fling = Gesture.Fling()
47
- .direction(Directions.UP | Directions.DOWN)
48
+ .direction(Directions.DOWN)
48
49
  .onEnd(() => {
49
50
  props.onDismiss && props.onDismiss()
50
51
  })
@@ -123,17 +124,24 @@ export const BottomSheet = (props: BottomSheetProps) => {
123
124
  <VBox style={{
124
125
  width: '100%'
125
126
  }}>
126
- <GestureDetector gesture={fling}>
127
- <ScrollView
128
- nestedScrollEnabled={true}
129
- showsVerticalScrollIndicator={false}
130
- style={{
131
- flex: 1,
132
- maxHeight: 500,
133
- }}>
134
- {props.children}
135
- </ScrollView>
136
- </GestureDetector>
127
+ {
128
+ props.swipeToCloseDisabled ? (
129
+ <ScrollView
130
+ nestedScrollEnabled={true}
131
+ showsVerticalScrollIndicator={false}
132
+ style={{
133
+ flex: 1,
134
+ maxHeight: 500,
135
+ }}>
136
+ {props.children}
137
+ </ScrollView>
138
+ ) : (
139
+ <GestureDetector gesture={fling}>
140
+ {props.children}
141
+ </GestureDetector>
142
+ )
143
+ }
144
+
137
145
 
138
146
  </VBox>
139
147
  </View>