From 7d4f6c0bbd6f82ec5a76796f001c2ae6dcf33d73 Mon Sep 17 00:00:00 2001 From: fmtabbara Date: Fri, 10 Jun 2022 21:49:26 +0100 Subject: [PATCH] give SimpleModal component a secondary action --- nym-wallet/src/components/Modals/SimpleModal.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/nym-wallet/src/components/Modals/SimpleModal.tsx b/nym-wallet/src/components/Modals/SimpleModal.tsx index 53e7c79d5a..f9438db18e 100644 --- a/nym-wallet/src/components/Modals/SimpleModal.tsx +++ b/nym-wallet/src/components/Modals/SimpleModal.tsx @@ -6,13 +6,14 @@ import { modalStyle } from './styles'; export const SimpleModal: React.FC<{ open: boolean; onClose?: () => void; - onOk?: () => void; + onOk?: () => Promise; header: string; subHeader?: string; okLabel: string; okDisabled?: boolean; sx?: SxProps; -}> = ({ open, onClose, okDisabled, onOk, header, subHeader, okLabel, sx, children }) => ( + SecondaryAction?: React.ReactNode; +}> = ({ open, onClose, okDisabled, onOk, header, subHeader, okLabel, sx, SecondaryAction, children }) => ( @@ -29,9 +30,11 @@ export const SimpleModal: React.FC<{ {children} - + + {SecondaryAction} );