react-native-boxes 1.4.19 → 1.4.20

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 +10 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-boxes",
3
- "version": "1.4.19",
3
+ "version": "1.4.20",
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
@@ -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,8 +528,12 @@ 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
- <BottomSheet
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
  }}
@@ -552,7 +558,7 @@ export function ConfirmationDialog(props: ConfirmationDialogProps) {
552
558
  }} />
553
559
  </VBox>
554
560
 
555
- </BottomSheet>
561
+ </Conatiner>
556
562
  )
557
563
  }
558
564