Skip to content

Commit

Permalink
Merge pull request #1616 from josiehandeveloper/Edit-on-save
Browse files Browse the repository at this point in the history
remove popup on the close button
  • Loading branch information
trillium authored Apr 16, 2024
2 parents 7044744 + 919a0df commit 409a65d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions client/src/components/ProjectForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default function ProjectForm({
const handleOpen = () => setIsModalOpen(true)
const handleClose = () => setIsModalOpen(false)
const checkFields = () => {
history.push("/projects")
history.push("/projects")
}

/**
Expand Down Expand Up @@ -233,14 +233,14 @@ export default function ProjectForm({
title={editMode ? 'Editing Project' : 'Project Information'}
badge={isEdit ? editIcon() : addIcon()}
>

<form
id="project-form"
onSubmit={handleSubmit((data) => {
isEdit ? submitEditProject(data) : submitNewProject(data);
})}
>

{arr.map((input) => (
<ValidatedTextField
key={input.name}
Expand All @@ -253,12 +253,12 @@ export default function ProjectForm({
input={input}
/>
))}
<ChangesModal
open={isModalOpen}
onClose={handleClose}
<ChangesModal
open={isModalOpen}
onClose={handleClose}
destination={'/projects'}
aria-labelledby="modal-modal-title"
aria-describedby="modal-modal-description"
aria-describedby="modal-modal-description"
handleClose={handleClose}
/>
</form>
Expand All @@ -279,7 +279,7 @@ export default function ProjectForm({
<StyledButton
variant="contained"
cursor="pointer"
onClick={Object.keys(dirtyFields).length > 0 ? handleOpen: checkFields}
onClick={!editMode || Object.keys(dirtyFields).length === 0 ? checkFields: handleOpen}
>
Close
</StyledButton>
Expand Down

0 comments on commit 409a65d

Please sign in to comment.