From 2a2b479f4797c0caa773e15b31ecf57dd980165c Mon Sep 17 00:00:00 2001 From: Nezzar KEFIF <36443340+nezz0746@users.noreply.github.com> Date: Wed, 30 Oct 2024 09:40:08 +0100 Subject: [PATCH 1/5] fix: add simple prompt on kyc modal making sure it doesn't close inadvertently --- src/components/Global/IframeWrapper/index.tsx | 49 +++++++++++++------ 1 file changed, 35 insertions(+), 14 deletions(-) diff --git a/src/components/Global/IframeWrapper/index.tsx b/src/components/Global/IframeWrapper/index.tsx index 5a3734dab..fec68c57b 100644 --- a/src/components/Global/IframeWrapper/index.tsx +++ b/src/components/Global/IframeWrapper/index.tsx @@ -1,17 +1,20 @@ -import { useEffect } from 'react' +import { useEffect, useState } from 'react' import Modal from '../Modal' +type IframeWrapperProps = { + src: string + style?: React.CSSProperties + visible: boolean + onClose: () => void +} + const IframeWrapper = ({ src, style, visible, onClose, -}: { - src: string - style?: React.CSSProperties - visible: boolean - onClose: () => void -}) => { +}: IframeWrapperProps) => { + const [areYouSure, setAreYouSure] = useState(false) useEffect(() => { const handleMessage = (event: MessageEvent) => { const expectedOrigin = window.location.origin @@ -28,10 +31,24 @@ const IframeWrapper = ({ } }, [onClose]) + const areYouSurePromptRow = ( +
Are you sure ? your KYC progress will be lost.
+Are you sure ? your KYC progress will be lost.
+Are you sure ? your KYC progress will be lost.
Are you sure ? your KYC progress will be lost.
+{closeConfirmMessage}
{closeConfirmMessage}