react-native-boxes 1.4.12 → 1.4.14

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 +37 -26
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-boxes",
3
- "version": "1.4.12",
3
+ "version": "1.4.14",
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
@@ -100,32 +100,35 @@ export const BottomSheet = (props: BottomSheetProps) => {
100
100
  paddingStart: theme.dimens.space.lg,
101
101
  paddingEnd: theme.dimens.space.lg,
102
102
  }]}>
103
- <HBox style={{
104
- justifyContent: 'space-between',
105
- width: '100%'
106
- }}>
107
- <View style={{ width: theme.dimens.icon.md }} />
108
- {
109
- typeof props.title == 'string' ? (
110
- <Subtitle style={{
111
- fontFamily: theme.fonts.Bold
112
- }}>{props.title.toString()}</Subtitle>
113
- ) : <>{props.title}</>
114
- }
115
- {
116
- cancellable ? (<TouchableOpacity
117
- style={{
118
- padding: theme.dimens.space.sm
119
- }}
120
- onPress={() => {
121
- cancel()
122
- }}>
123
- <CloseIcon />
124
- </TouchableOpacity>) : (
125
- <View style={{ width: theme.dimens.icon.md }} />
126
- )
127
- }
128
- </HBox>
103
+ <GestureDetector gesture={fling}>
104
+ <HBox style={{
105
+ justifyContent: 'space-between',
106
+ width: '100%'
107
+ }}>
108
+
109
+ <View style={{ width: theme.dimens.icon.md }} />
110
+ {
111
+ typeof props.title == 'string' ? (
112
+ <Subtitle style={{
113
+ fontFamily: theme.fonts.Bold
114
+ }}>{props.title.toString()}</Subtitle>
115
+ ) : <>{props.title}</>
116
+ }
117
+ {
118
+ cancellable ? (<TouchableOpacity
119
+ style={{
120
+ padding: theme.dimens.space.sm
121
+ }}
122
+ onPress={() => {
123
+ cancel()
124
+ }}>
125
+ <CloseIcon />
126
+ </TouchableOpacity>) : (
127
+ <View style={{ width: theme.dimens.icon.md }} />
128
+ )
129
+ }
130
+ </HBox>
131
+ </GestureDetector>
129
132
  <VBox style={{
130
133
  width: '100%'
131
134
  }}>
@@ -357,7 +360,14 @@ export type DropDownViewProps = {
357
360
  displayType?: 'button' | 'input',
358
361
  onRenderOption?: (opt: DropDownViewOption) => any,
359
362
  forceDialogSelectOnWeb?: Boolean
363
+ swipeToCloseDisabled?: boolean
360
364
  } & ViewProps
365
+
366
+ /**
367
+ * set swipeToCloseDisabled = true if you face issues with scrolling
368
+ * @param props
369
+ * @returns
370
+ */
361
371
  export const DropDownView = (props: DropDownViewProps) => {
362
372
  const displayType = props.displayType || 'input'
363
373
  const theme = useContext(ThemeContext)
@@ -404,6 +414,7 @@ export const DropDownView = (props: DropDownViewProps) => {
404
414
  return (
405
415
  <VBox style={props.style}>
406
416
  <BottomSheet
417
+ swipeToCloseDisabled={props.swipeToCloseDisabled}
407
418
  visible={visible as boolean}
408
419
  onDismiss={() => {
409
420
  setVisible(false)