Skip to content

Commit

Permalink
updated projectform.jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
lcchrty committed Sep 24, 2024
1 parent efb3345 commit d58b301
Showing 1 changed file with 33 additions and 3 deletions.
36 changes: 33 additions & 3 deletions client/src/components/ProjectForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ export default function ProjectForm({
!isEdit ? 'secondary' : !editMode ? 'contained' : 'secondary'
}
cursor="pointer"
disabled={isEdit && !isLoading ? !editMode : false}
disabled={isEdit && isLoading ? !editMode : false}
>
{isLoading ? <CircularProgress /> : 'Save'}
</StyledButton>
Expand All @@ -302,10 +302,40 @@ export default function ProjectForm({
</Grid>
</Box>
) : (
''
<TitledBox title={'Project Information'}>
{' '}
<form
id="project-form"
onSubmit={handleSubmit((data) => {
isEdit ? submitEditProject(data) : submitNewProject(data);
})}
>
{arr.map((input) => (
<ValidatedTextField
key={input.name}
register={register}
isEdit={isEdit}
editMode={editMode}
locationType={locationType}
locationRadios={locationRadios}
errors={errors}
input={input}
/>
))}
<ChangesModal
open={isModalOpen}
onClose={handleClose}
destination={'/projects'}
aria-labelledby="modal-modal-title"
aria-describedby="modal-modal-description"
handleClose={handleClose}
/>
</form>
{''}
</TitledBox>
)}
</Box>
) : (
<Redirect to="/login" />
);
}
}

0 comments on commit d58b301

Please sign in to comment.