diff --git a/client/src/components/ProjectForm.jsx b/client/src/components/ProjectForm.jsx index f66e2fac..588f88ec 100644 --- a/client/src/components/ProjectForm.jsx +++ b/client/src/components/ProjectForm.jsx @@ -11,6 +11,7 @@ import { FormControl, FormControlLabel, RadioGroup, + Paper, } from '@mui/material'; import { styled } from '@mui/material/styles'; @@ -21,6 +22,7 @@ import PlusIcon from '../svg/PlusIcon.svg?react'; import ValidatedTextField from './parts/form/ValidatedTextField'; import TitledBox from './parts/boxes/TitledBox'; import ChangesModal from './ChangesModal'; +import { simpleInputs, additionalInputsForEdit } from './data'; /** STYLES * -most TextField and InputLabel styles are controlled by the theme @@ -234,19 +236,40 @@ export default function ProjectForm({ Project Management - {auth.user.accessLevel === 'admin' || - auth.user.accessLevel == 'superadmin' ? ( - + {auth.user.accessLevel === 'admin' ? ( + + ) : ( + + )} + +
{ + isEdit ? submitEditProject(data) : submitNewProject(data); + })} > - { - isEdit ? submitEditProject(data) : submitNewProject(data); - })} - > - {arr.map((input) => ( + {simpleInputs.map((input) => ( + + ))} + {isEdit && + additionalInputsForEdit.map((input) => ( ))} - - {' '} + + + + + {auth.user.accessLevel === 'admin' ? ( + + - - - - {input.label} - + + + + + {input.label} + + + {input.name === 'location' && locationRadios} - {input.name === 'location' && locationRadios} - - - + + ); -}; +} -export default ValidatedTextField; \ No newline at end of file +export default ValidatedTextField;