react-native-boxes 1.4.53 → 1.4.55
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 +22 -14
package/package.json
CHANGED
package/src/Modal.tsx
CHANGED
|
@@ -641,11 +641,14 @@ export type ConfirmationDialogProps = {
|
|
|
641
641
|
noSheet?: boolean,
|
|
642
642
|
style?: ViewStyle
|
|
643
643
|
}
|
|
644
|
-
|
|
645
644
|
export function ConfirmationDialog(props: ConfirmationDialogProps) {
|
|
646
645
|
|
|
647
|
-
|
|
648
|
-
|
|
646
|
+
return <GenericDialog {...props} cancelText={props.cancelText || 'Cancel'} confirmText={props.confirmText || 'Confirm'} />
|
|
647
|
+
}
|
|
648
|
+
export function GenericDialog(props: ConfirmationDialogProps) {
|
|
649
|
+
|
|
650
|
+
const confirmText = props.confirmText
|
|
651
|
+
const cancelText = props.cancelText
|
|
649
652
|
const theme = useContext(ThemeContext)
|
|
650
653
|
const Conatiner = props?.noSheet ? VBox : BottomSheet
|
|
651
654
|
return (
|
|
@@ -665,19 +668,24 @@ export function ConfirmationDialog(props: ConfirmationDialogProps) {
|
|
|
665
668
|
padding: theme.dimens.space.lg,
|
|
666
669
|
textAlign: 'center'
|
|
667
670
|
}}>{props.message}</TextView>}
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
props.onConfirm && props.onConfirm()
|
|
671
|
-
}} />
|
|
672
|
-
<TertiaryButtonView
|
|
673
|
-
aria-label={props.title as string}
|
|
674
|
-
style={{
|
|
675
|
-
marginTop: 0
|
|
676
|
-
}}
|
|
677
|
-
text={cancelText as string} onPress={() => {
|
|
671
|
+
{
|
|
672
|
+
confirmText && <ButtonView aria-label={props.title as string} text={confirmText as string} onPress={() => {
|
|
678
673
|
props.onDismiss && props.onDismiss()
|
|
679
|
-
props.
|
|
674
|
+
props.onConfirm && props.onConfirm()
|
|
680
675
|
}} />
|
|
676
|
+
}
|
|
677
|
+
{
|
|
678
|
+
cancelText && <TertiaryButtonView
|
|
679
|
+
aria-label={props.title as string}
|
|
680
|
+
style={{
|
|
681
|
+
marginTop: 0
|
|
682
|
+
}}
|
|
683
|
+
text={cancelText as string} onPress={() => {
|
|
684
|
+
props.onDismiss && props.onDismiss()
|
|
685
|
+
props.onCancel && props.onCancel()
|
|
686
|
+
}} />
|
|
687
|
+
}
|
|
688
|
+
|
|
681
689
|
</VBox>
|
|
682
690
|
|
|
683
691
|
</Conatiner>
|