react-native-boxes 1.4.54 → 1.4.56

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 +18 -13
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-boxes",
3
- "version": "1.4.54",
3
+ "version": "1.4.56",
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
@@ -647,8 +647,8 @@ export function ConfirmationDialog(props: ConfirmationDialogProps) {
647
647
  }
648
648
  export function GenericDialog(props: ConfirmationDialogProps) {
649
649
 
650
- const confirmText = props.confirmText || 'Confirm'
651
- const cancelText = props.cancelText || 'Cancel'
650
+ const confirmText = props.confirmText
651
+ const cancelText = props.cancelText
652
652
  const theme = useContext(ThemeContext)
653
653
  const Conatiner = props?.noSheet ? VBox : BottomSheet
654
654
  return (
@@ -668,19 +668,24 @@ export function GenericDialog(props: ConfirmationDialogProps) {
668
668
  padding: theme.dimens.space.lg,
669
669
  textAlign: 'center'
670
670
  }}>{props.message}</TextView>}
671
- <ButtonView aria-label={props.title as string} text={confirmText as string} onPress={() => {
672
- props.onDismiss && props.onDismiss()
673
- props.onConfirm && props.onConfirm()
674
- }} />
675
- <TertiaryButtonView
676
- aria-label={props.title as string}
677
- style={{
678
- marginTop: 0
679
- }}
680
- text={cancelText as string} onPress={() => {
671
+ {
672
+ confirmText && <ButtonView aria-label={props.title as string} text={confirmText as string} onPress={() => {
681
673
  props.onDismiss && props.onDismiss()
682
- props.onCancel && props.onCancel()
674
+ props.onConfirm && props.onConfirm()
683
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
+
684
689
  </VBox>
685
690
 
686
691
  </Conatiner>