Skip to content

Commit

Permalink
Issue #PS-0000 chore: modal overlap issue fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
suvarnakale committed Aug 13, 2024
1 parent fd41554 commit 7072544
Showing 1 changed file with 59 additions and 54 deletions.
113 changes: 59 additions & 54 deletions src/components/AddFacilitator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ const AddFacilitatorModal: React.FC<AddFacilitatorModalprops> = ({
const [schema, setSchema] = React.useState<any>();
const [openSendCredModal, setOpenSendCredModal] = React.useState(false);
const [createFacilitator, setCreateFacilitator] = React.useState(false);
const [isVisible, setIsVisible] = React.useState(true);
const [uiSchema, setUiSchema] = React.useState<any>();
const [reloadProfile, setReloadProfile] = React.useState(false);
const [email, setEmail] = React.useState('');
Expand Down Expand Up @@ -142,6 +143,7 @@ const AddFacilitatorModal: React.FC<AddFacilitatorModalprops> = ({
useEffect(() => {
if (formData) {
handleButtonClick();
setIsVisible(false);
}
}, [formData, createFacilitator]);

Expand Down Expand Up @@ -333,6 +335,7 @@ const AddFacilitatorModal: React.FC<AddFacilitatorModalprops> = ({
};

const handleBackAction = () => {
setIsVisible(true);
setCreateFacilitator(false);
setOpenSendCredModal(false);
};
Expand All @@ -346,60 +349,62 @@ const AddFacilitatorModal: React.FC<AddFacilitatorModalprops> = ({

return (
<>
<SimpleModal
open={open}
onClose={onClose}
showFooter={false}
modalTitle={
isEditModal
? t('COMMON.EDIT_FACILITATOR')
: t('COMMON.NEW_FACILITATOR')
}
>
{userFormData
? schema &&
uiSchema && (
<DynamicForm
schema={schema}
uiSchema={uiSchema}
onSubmit={handleSubmit}
onChange={handleChange}
onError={handleError}
widgets={{}}
showErrorList={true}
customFields={customFields}
formData={userFormData}
>
{/* <CustomSubmitButton onClose={primaryActionHandler} /> */}
<FormButtons
formData={formData}
onClick={handleButtonClick}
isSingleButton={true}
/>
</DynamicForm>
)
: schema &&
uiSchema && (
<DynamicForm
schema={schema}
uiSchema={uiSchema}
onSubmit={handleSubmit}
onChange={handleChange}
onError={handleError}
widgets={{}}
showErrorList={true}
customFields={customFields}
formData={createFacilitator ? '' : formData}
>
<FormButtons
formData={formData}
onClick={handleButtonClick}
isCreatedFacilitator={true}
isCreateCentered={false}
/>{' '}
</DynamicForm>
)}
</SimpleModal>
{isVisible && (
<SimpleModal
open={open}
onClose={onClose}
showFooter={false}
modalTitle={
isEditModal
? t('COMMON.EDIT_FACILITATOR')
: t('COMMON.NEW_FACILITATOR')
}
>
{userFormData
? schema &&
uiSchema && (
<DynamicForm
schema={schema}
uiSchema={uiSchema}
onSubmit={handleSubmit}
onChange={handleChange}
onError={handleError}
widgets={{}}
showErrorList={true}
customFields={customFields}
formData={userFormData}
>
{/* <CustomSubmitButton onClose={primaryActionHandler} /> */}
<FormButtons
formData={formData}
onClick={handleButtonClick}
isSingleButton={true}
/>
</DynamicForm>
)
: schema &&
uiSchema && (
<DynamicForm
schema={schema}
uiSchema={uiSchema}
onSubmit={handleSubmit}
onChange={handleChange}
onError={handleError}
widgets={{}}
showErrorList={true}
customFields={customFields}
formData={createFacilitator ? '' : formData}
>
<FormButtons
formData={formData}
onClick={handleButtonClick}
isCreatedFacilitator={true}
isCreateCentered={false}
/>{' '}
</DynamicForm>
)}
</SimpleModal>
)}
<Modal
open={openSendCredModal}
aria-labelledby="send credential modal"
Expand Down

0 comments on commit 7072544

Please sign in to comment.