From 7072544bde0e16e9dcfc6da8e1443b8e432bd511 Mon Sep 17 00:00:00 2001 From: suvarnakale Date: Tue, 13 Aug 2024 17:51:21 +0530 Subject: [PATCH] Issue #PS-0000 chore: modal overlap issue fixed --- src/components/AddFacilitator.tsx | 113 ++++++++++++++++-------------- 1 file changed, 59 insertions(+), 54 deletions(-) diff --git a/src/components/AddFacilitator.tsx b/src/components/AddFacilitator.tsx index 8dc74555..c9fae79c 100644 --- a/src/components/AddFacilitator.tsx +++ b/src/components/AddFacilitator.tsx @@ -52,6 +52,7 @@ const AddFacilitatorModal: React.FC = ({ const [schema, setSchema] = React.useState(); const [openSendCredModal, setOpenSendCredModal] = React.useState(false); const [createFacilitator, setCreateFacilitator] = React.useState(false); + const [isVisible, setIsVisible] = React.useState(true); const [uiSchema, setUiSchema] = React.useState(); const [reloadProfile, setReloadProfile] = React.useState(false); const [email, setEmail] = React.useState(''); @@ -142,6 +143,7 @@ const AddFacilitatorModal: React.FC = ({ useEffect(() => { if (formData) { handleButtonClick(); + setIsVisible(false); } }, [formData, createFacilitator]); @@ -333,6 +335,7 @@ const AddFacilitatorModal: React.FC = ({ }; const handleBackAction = () => { + setIsVisible(true); setCreateFacilitator(false); setOpenSendCredModal(false); }; @@ -346,60 +349,62 @@ const AddFacilitatorModal: React.FC = ({ return ( <> - - {userFormData - ? schema && - uiSchema && ( - - {/* */} - - - ) - : schema && - uiSchema && ( - - {' '} - - )} - + {isVisible && ( + + {userFormData + ? schema && + uiSchema && ( + + {/* */} + + + ) + : schema && + uiSchema && ( + + {' '} + + )} + + )}