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 && ( + + {' '} + + )} + + )}