@@ -17,14 +17,14 @@ export interface ConfirmDialogProps
1717export interface ConfirmDialogHeaderProps {
1818 /** Title displayed in the header */
1919 title ?: string ;
20- onClose ?: ( ) => void ;
20+ onRequestClose ?: ( ) => void ;
2121 theme : Theme ;
2222}
2323
2424const ConfirmDialogHeader = ( {
2525 title,
2626 theme,
27- onClose ,
27+ onRequestClose ,
2828} : ConfirmDialogHeaderProps ) => (
2929 < Spacing
3030 padding = { 2 }
@@ -33,7 +33,7 @@ const ConfirmDialogHeader = ({
3333 alignItems = "center"
3434 >
3535 < Heading > { title } </ Heading >
36- < TouchableOpacity onPress = { onClose } >
36+ < TouchableOpacity onPress = { onRequestClose } >
3737 < Icon name = "x" size = { 24 } color = { theme . colors . text . default } />
3838 </ TouchableOpacity >
3939 </ Spacing >
@@ -48,18 +48,18 @@ export interface ConfirmDialogFooterProps {
4848 /** Handler for confirm button */
4949 onConfirm ?: ( ) => void ;
5050 /** Handler for cancel button */
51- onClose ?: ( ) => void ;
51+ onRequestClose ?: ( ) => void ;
5252}
5353
5454const ConfirmDialogFooter = ( {
5555 color = 'primary' ,
56- onClose ,
56+ onRequestClose ,
5757 onConfirm,
5858 cancelLabel,
5959 confirmLabel,
6060} : ConfirmDialogFooterProps ) => (
6161 < Spacing padding = { 2 } flexDirection = "row" justifyContent = "flex-end" >
62- < Button appearance = "minimal" onPress = { onClose } title = { cancelLabel } />
62+ < Button appearance = "minimal" onPress = { onRequestClose } title = { cancelLabel } />
6363 < Spacing paddingLeft = { 2 } >
6464 < Button color = { color } onPress = { onConfirm } title = { confirmLabel } />
6565 </ Spacing >
@@ -73,7 +73,7 @@ const ConfirmDialogBase = (props: ConfirmDialogProps) => {
7373 confirmLabel = 'Confirm' ,
7474 footer,
7575 header,
76- onClose ,
76+ onRequestClose ,
7777 onConfirm,
7878 title,
7979 theme,
@@ -88,7 +88,7 @@ const ConfirmDialogBase = (props: ConfirmDialogProps) => {
8888 : header || (
8989 < ConfirmDialogHeader
9090 theme = { theme }
91- onClose = { onClose }
91+ onRequestClose = { onRequestClose }
9292 title = { title }
9393 />
9494 )
@@ -98,14 +98,14 @@ const ConfirmDialogBase = (props: ConfirmDialogProps) => {
9898 ? null
9999 : footer || (
100100 < ConfirmDialogFooter
101- onClose = { onClose }
101+ onRequestClose = { onRequestClose }
102102 onConfirm = { onConfirm }
103103 cancelLabel = { cancelLabel }
104104 confirmLabel = { confirmLabel }
105105 />
106106 )
107107 }
108- onClose = { onClose }
108+ onRequestClose = { onRequestClose }
109109 { ...dialogProps }
110110 >
111111 < Spacing padding = { 2 } > { children } </ Spacing >
0 commit comments