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.
- package/package.json +1 -1
- package/src/Modal.tsx +37 -26
package/package.json
CHANGED
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
|
-
<
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
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)
|