@@ -3,7 +3,8 @@ import React, {useCallback, useState, forwardRef, PropsWithChildren, useImperati
3
3
import TouchableOpacity , { TouchableOpacityProps } from '../../components/touchableOpacity' ;
4
4
import View from '../../components/view' ;
5
5
import Modal , { ModalProps , ModalTopBarProps } from '../../components/modal' ;
6
- import Dialog , { DialogProps } from '../../components/dialog' ;
6
+ import DialogOld , { DialogProps as DialogPropsOld } from '../../components/dialog' ;
7
+ import DialogNew , { DialogProps as DialogPropsNew } from '../Dialog' ;
7
8
import { Colors } from 'style' ;
8
9
9
10
export interface ExpandableOverlayMethods {
@@ -33,7 +34,11 @@ export type ExpandableOverlayProps = TouchableOpacityProps &
33
34
/**
34
35
* The props to pass to the dialog expandable container
35
36
*/
36
- dialogProps ?: DialogProps ;
37
+ dialogProps ?: DialogPropsOld | DialogPropsNew ;
38
+ /**
39
+ * Migrate the Dialog to DialogNew (make sure you use only new props in dialogProps)
40
+ */
41
+ migrateDialog ?: boolean ;
37
42
/**
38
43
* Whether to render a modal top bar (relevant only for modal)
39
44
*/
@@ -59,6 +64,7 @@ const ExpandableOverlay = (props: ExpandableOverlayProps, ref: any) => {
59
64
useDialog,
60
65
modalProps,
61
66
dialogProps,
67
+ migrateDialog,
62
68
showTopBar,
63
69
topBarProps,
64
70
renderCustomOverlay,
@@ -103,7 +109,9 @@ const ExpandableOverlay = (props: ExpandableOverlayProps, ref: any) => {
103
109
} ;
104
110
105
111
const renderDialog = ( ) => {
112
+ const Dialog = migrateDialog ? DialogNew : DialogOld ;
106
113
return (
114
+ // @ts -expect-error
107
115
< Dialog testID = { `${ testID } .overlay` } { ...dialogProps } visible = { visible } onDismiss = { closeExpandable } >
108
116
{ expandableContent }
109
117
</ Dialog >
0 commit comments