react-native-boxes 1.4.19 → 1.4.21
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 +12 -4
package/package.json
CHANGED
package/src/Modal.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useContext, useEffect, useRef, useState } from 'react';
|
|
3
|
-
import { Animated, Button, Easing, LayoutChangeEvent, Linking, Modal, Platform, Pressable, ScrollView, StyleProp, StyleSheet, TextStyle, TouchableHighlight, TouchableOpacity, View, ViewProps } from 'react-native';
|
|
3
|
+
import { Animated, Button, Easing, LayoutChangeEvent, Linking, Modal, Platform, Pressable, ScrollView, StyleProp, StyleSheet, TextStyle, TouchableHighlight, TouchableOpacity, View, ViewProps, ViewStyle } from 'react-native';
|
|
4
4
|
import { getIcon, Icon, IconProps } from './Image';
|
|
5
5
|
import { getNavParamsFromDeeplink, isDesktop, isWeb } from './utils';
|
|
6
6
|
import { ThemeContext } from './ThemeContext';
|
|
@@ -518,7 +518,9 @@ export type ConfirmationDialogProps = {
|
|
|
518
518
|
message?: string,
|
|
519
519
|
confirmText?: String,
|
|
520
520
|
cancelText?: String,
|
|
521
|
-
children?: any
|
|
521
|
+
children?: any,
|
|
522
|
+
noSheet?: boolean,
|
|
523
|
+
style?: ViewStyle
|
|
522
524
|
}
|
|
523
525
|
|
|
524
526
|
export function ConfirmationDialog(props: ConfirmationDialogProps) {
|
|
@@ -526,14 +528,20 @@ export function ConfirmationDialog(props: ConfirmationDialogProps) {
|
|
|
526
528
|
const confirmText = props.confirmText || 'Confirm'
|
|
527
529
|
const cancelText = props.cancelText || 'Cancel'
|
|
528
530
|
const theme = useContext(ThemeContext)
|
|
531
|
+
const Conatiner = props?.noSheet ? VBox : BottomSheet
|
|
529
532
|
return (
|
|
530
|
-
<
|
|
533
|
+
<Conatiner
|
|
534
|
+
style={[props?.noSheet ? {
|
|
535
|
+
display: props.visible ? 'flex' : 'none'
|
|
536
|
+
} : {}, props.style]}
|
|
531
537
|
onDismiss={() => {
|
|
532
538
|
props.onDismiss && props.onDismiss()
|
|
533
539
|
}}
|
|
534
540
|
{...props}
|
|
535
541
|
>
|
|
536
542
|
<VBox>
|
|
543
|
+
{(props?.noSheet && props.title) ? <Center><Subtitle>{props.title as any}</Subtitle></Center> : null}
|
|
544
|
+
|
|
537
545
|
{props.message && <TextView style={{
|
|
538
546
|
padding: theme.dimens.space.lg,
|
|
539
547
|
textAlign: 'center'
|
|
@@ -552,7 +560,7 @@ export function ConfirmationDialog(props: ConfirmationDialogProps) {
|
|
|
552
560
|
}} />
|
|
553
561
|
</VBox>
|
|
554
562
|
|
|
555
|
-
</
|
|
563
|
+
</Conatiner>
|
|
556
564
|
)
|
|
557
565
|
}
|
|
558
566
|
|