From 599b32fe74f97a757ac8cce3d8eb49325beb98af Mon Sep 17 00:00:00 2001 From: Kaipher Date: Mon, 6 Oct 2025 23:59:36 -0400 Subject: [PATCH 1/2] Removed unused variables and imports --- client/src/components/ChangesModal.jsx | 133 ++++++++++++++----------- client/src/components/ProjectForm.jsx | 62 ++++++------ 2 files changed, 101 insertions(+), 94 deletions(-) diff --git a/client/src/components/ChangesModal.jsx b/client/src/components/ChangesModal.jsx index 5eff6315..669d7a18 100644 --- a/client/src/components/ChangesModal.jsx +++ b/client/src/components/ChangesModal.jsx @@ -1,16 +1,8 @@ -import React from 'react' -import { - Modal, - Box, - Typography, - Grid - } from '@mui/material' - import { StyledButton } from './ProjectForm'; - import { Link } from 'react-router-dom'; - import WarningAmberRoundedIcon from '@mui/icons-material/WarningAmberRounded'; +import { Modal, Box, Typography, Grid, Button } from '@mui/material'; +import { Link } from 'react-router-dom'; +import WarningAmberRoundedIcon from '@mui/icons-material/WarningAmberRounded'; - - const style = { +const style = { position: 'absolute', top: '50%', left: '50%', @@ -18,56 +10,77 @@ import { width: 400, bgcolor: 'background.paper', border: '2px solid #000', - boxShadow: 24, + boxShaodw: 24, p: 4, }; +export default function ChangesModal({ + open, + onClose, + handleClose, + destination, +}) { + return ( + + + + + - export default function ChangesModal({open, onClose, handleClose, destination }) { - return ( - - - - - - - - - Wait! You made some changes. - - - Are you sure you want to exit without saving? - - - - - Yes - - - - - No - - + + Wait! You made some changes. + + + Are you sure you want to exit without saving? + + + + + + + - - - ) - } \ No newline at end of file + + + + ); +} diff --git a/client/src/components/ProjectForm.jsx b/client/src/components/ProjectForm.jsx index f66e2fac..7bcc4fb3 100644 --- a/client/src/components/ProjectForm.jsx +++ b/client/src/components/ProjectForm.jsx @@ -1,4 +1,4 @@ -import React, { useState } from 'react'; +import { useState } from 'react'; import { useHistory } from 'react-router-dom'; import { useForm, useFormState } from 'react-hook-form'; import { @@ -12,7 +12,6 @@ import { FormControlLabel, RadioGroup, } from '@mui/material'; -import { styled } from '@mui/material/styles'; import useAuth from '../hooks/useAuth'; import ProjectApiService from '../api/ProjectApiService'; @@ -28,22 +27,6 @@ import ChangesModal from './ChangesModal'; * -the rest are inline */ -export const StyledButton = styled(Button)(({ theme }) => ({ - width: '150px', -})); - -const StyledFormControlLabel = styled(FormControlLabel)(({ theme }) => ({ - width: 'max-content', - '& .MuiFormControlLabel-label': { - fontSize: '14px', - }, -})); - -const StyledRadio = styled(Radio)(({ theme }) => ({ - padding: '0px 0px 0px 0px', - marginRight: '.5rem', -})); - /**Project Form Component * -renders a form for creating and updating a project @@ -145,11 +128,12 @@ export default function ProjectForm({ // Handles the location radio button change. const handleRadioChange = (event) => { + alert(event.target.value); setLocationType(event.target.value); }; // Toggles the project view to edit mode change. - const handleEditMode = (event) => { + const handleEditMode = () => { setEditMode(!editMode); // React hook form method to reset data back to original values. Triggered when Edit Mode is cancelled. reset({ @@ -211,16 +195,16 @@ export default function ProjectForm({ onChange={handleRadioChange} sx={{ mb: 0.5 }} > - } + control={} label="Remote" disabled={isEdit ? !editMode : false} /> - } + control={} label="In-Person" disabled={isEdit ? !editMode : false} /> @@ -240,7 +224,8 @@ export default function ProjectForm({ title={editMode ? 'Editing Project' : 'Project Information'} badge={isEdit ? editIcon() : addIcon()} > -
{ isEdit ? submitEditProject(data) : submitNewProject(data); @@ -266,25 +251,31 @@ export default function ProjectForm({ aria-describedby="modal-modal-description" handleClose={handleClose} /> -
{' '} +
{' '} - {isLoading ? : 'Save'} - + - Close - + ) : ( - {' '} -
+ Project Information + {' '} + { isEdit ? submitEditProject(data) : submitNewProject(data); @@ -325,7 +319,7 @@ export default function ProjectForm({ aria-describedby="modal-modal-description" handleClose={handleClose} /> - +
{''}
)} From 96c022c98051338cee9904b6e1bcc8513baf0902 Mon Sep 17 00:00:00 2001 From: Kaipher Date: Tue, 7 Oct 2025 11:46:14 -0400 Subject: [PATCH 2/2] Typo in styles boxshadow --- client/src/components/ChangesModal.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/components/ChangesModal.jsx b/client/src/components/ChangesModal.jsx index 669d7a18..275c4750 100644 --- a/client/src/components/ChangesModal.jsx +++ b/client/src/components/ChangesModal.jsx @@ -10,7 +10,7 @@ const style = { width: 400, bgcolor: 'background.paper', border: '2px solid #000', - boxShaodw: 24, + boxShadow: 24, p: 4, };