From 412854ea182144e7b588c721ab9b95e7a622f02a Mon Sep 17 00:00:00 2001 From: Eric Sun Date: Wed, 18 Sep 2024 23:22:28 -0400 Subject: [PATCH 1/6] add maintenance checklist popup --- .../MaintenanceChecklistPopup.tsx | 84 +++++++++++++++++++ .../volunteerDashboard/VolunteerDashboard.tsx | 48 +++++++++-- .../src/pages/volunteerPage/VolunteerPage.tsx | 11 ++- 3 files changed, 133 insertions(+), 10 deletions(-) create mode 100644 apps/frontend/src/components/volunteerDashboard/MaintenanceChecklistPopup.tsx diff --git a/apps/frontend/src/components/volunteerDashboard/MaintenanceChecklistPopup.tsx b/apps/frontend/src/components/volunteerDashboard/MaintenanceChecklistPopup.tsx new file mode 100644 index 00000000..ba27d5b7 --- /dev/null +++ b/apps/frontend/src/components/volunteerDashboard/MaintenanceChecklistPopup.tsx @@ -0,0 +1,84 @@ +import Button from '@mui/material/Button'; +import Dialog from '@mui/material/Dialog'; +import DialogActions from '@mui/material/DialogActions'; +import DialogContent from '@mui/material/DialogContent'; +import DialogContentText from '@mui/material/DialogContentText'; +import DialogTitle from '@mui/material/DialogTitle'; +import { useState } from 'react'; +import Box from '@mui/material/Box'; +import InputLabel from '@mui/material/InputLabel'; +import MenuItem from '@mui/material/MenuItem'; +import FormControl from '@mui/material/FormControl'; +import Select, { SelectChangeEvent } from '@mui/material/Select'; +import IconButton from '@material-ui/core/IconButton'; +import CloseIcon from '@material-ui/icons/Close'; + +interface MaintenanceChecklistPopupProps { + maintenanceChecklistOpen: boolean; + setMaintenanceChecklistOpen: React.Dispatch>; +} + +export default function MaintenanceChecklistPopup({ + maintenanceChecklistOpen, + setMaintenanceChecklistOpen, +}: MaintenanceChecklistPopupProps) { + const [site, setSite] = useState(''); + + const handleClose = () => { + setMaintenanceChecklistOpen(false); + }; + + const handleChange = (event: SelectChangeEvent) => { + setSite(event.target.value as string); + }; + + const handleSubmit = (event: React.FormEvent) => { + // TODO: Add logic to display the maintenance checklist for the selected site + event.preventDefault(); + console.log(site); + handleClose(); + }; + + return ( + + + + Maintenance Visit Checklist + + + + + + + + + + Select the site you'd like to see a checklist for: + + + Site + + + + + + + + ); +} diff --git a/apps/frontend/src/components/volunteerDashboard/VolunteerDashboard.tsx b/apps/frontend/src/components/volunteerDashboard/VolunteerDashboard.tsx index 27644be1..31a303c4 100644 --- a/apps/frontend/src/components/volunteerDashboard/VolunteerDashboard.tsx +++ b/apps/frontend/src/components/volunteerDashboard/VolunteerDashboard.tsx @@ -18,7 +18,13 @@ const boxStyles = { fontSize: '30px', }; -function VolunteerDashboard() { +interface VolunteerDashboardProps { + setMaintenanceChecklistOpen: React.Dispatch>; +} + +function VolunteerDashboard({ + setMaintenanceChecklistOpen, +}: VolunteerDashboardProps) { return (
- - - My Adopted Green Infrastructure - - + + + My Adopted Green Infrastructure + + - - Adoption Map + + + Adoption Map + Maintenance Guide @@ -100,7 +126,11 @@ function VolunteerDashboard() { className="column2" style={{ paddingTop: '2%', paddingBottom: '2%', width: '55%' }} > - + setMaintenanceChecklistOpen(true)} + style={{ cursor: 'pointer' }} + > Maintenance Visit Checklist
diff --git a/apps/frontend/src/pages/volunteerPage/VolunteerPage.tsx b/apps/frontend/src/pages/volunteerPage/VolunteerPage.tsx index d37e447b..2cb40d15 100644 --- a/apps/frontend/src/pages/volunteerPage/VolunteerPage.tsx +++ b/apps/frontend/src/pages/volunteerPage/VolunteerPage.tsx @@ -1,5 +1,6 @@ import Navbar from '../Navbar'; import VolunteerDashboard from '../../components/volunteerDashboard/VolunteerDashboard'; +import MaintenanceChecklistPopup from '../../components/volunteerDashboard/MaintenanceChecklistPopup'; import Map from '../../components/map/Map'; import MapLegend from '../../components/map/MapLegend'; import { useState } from 'react'; @@ -10,12 +11,20 @@ const icons: string[] = SITE_STATUS_ROADMAP.map((option) => option.image); export default function VolunteerPage() { const [selectedFeatures, setSelectedFeatures] = useState([]); const [selectedStatuses, setSelectedStatuses] = useState([]); + const [maintenanceChecklistOpen, setMaintenanceChecklistOpen] = + useState(false); return (
- + +
Date: Mon, 23 Sep 2024 19:45:10 -0400 Subject: [PATCH 2/6] update font --- .../MaintenanceChecklistPopup.tsx | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/apps/frontend/src/components/volunteerDashboard/MaintenanceChecklistPopup.tsx b/apps/frontend/src/components/volunteerDashboard/MaintenanceChecklistPopup.tsx index ba27d5b7..55414042 100644 --- a/apps/frontend/src/components/volunteerDashboard/MaintenanceChecklistPopup.tsx +++ b/apps/frontend/src/components/volunteerDashboard/MaintenanceChecklistPopup.tsx @@ -50,7 +50,7 @@ export default function MaintenanceChecklistPopup({ > - Maintenance Visit Checklist + Maintenance Visit Checklist @@ -59,8 +59,8 @@ export default function MaintenanceChecklistPopup({ - - Select the site you'd like to see a checklist for: + + Select the site you'd like to see a checklist for Site @@ -69,6 +69,21 @@ export default function MaintenanceChecklistPopup({ value={site} label="Site" onChange={handleChange} + sx={{fontFamily: 'Montserrat', fontSize: '20px', fontWeight: '400'}} + MenuProps={{ + PaperProps: { + sx: { + '& .MuiMenuItem-root': { + fontFamily: 'Montserrat', + fontSize: '20px', + fontWeight: '400', + '&:hover': { + fontWeight: '600', + }, + }, + }, + }, + }} > Rain Garden 1 Green Roof 2 From 97fc52fb0a3f17c06fd39b917db06abf564f39c5 Mon Sep 17 00:00:00 2001 From: ItsEricSun Date: Mon, 23 Sep 2024 19:52:16 -0400 Subject: [PATCH 3/6] add "Most recently adopted" placeholder text --- .../volunteerDashboard/MaintenanceChecklistPopup.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/frontend/src/components/volunteerDashboard/MaintenanceChecklistPopup.tsx b/apps/frontend/src/components/volunteerDashboard/MaintenanceChecklistPopup.tsx index 55414042..5116cb94 100644 --- a/apps/frontend/src/components/volunteerDashboard/MaintenanceChecklistPopup.tsx +++ b/apps/frontend/src/components/volunteerDashboard/MaintenanceChecklistPopup.tsx @@ -63,12 +63,17 @@ export default function MaintenanceChecklistPopup({ Select the site you'd like to see a checklist for - Site - - + + ); From d40c67f86a326e8303c203038ded3d2c096e72ae Mon Sep 17 00:00:00 2001 From: ItsEricSun Date: Mon, 23 Sep 2024 21:59:19 -0400 Subject: [PATCH 5/6] remove unused import --- .../components/volunteerDashboard/MaintenanceChecklistPopup.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/frontend/src/components/volunteerDashboard/MaintenanceChecklistPopup.tsx b/apps/frontend/src/components/volunteerDashboard/MaintenanceChecklistPopup.tsx index 77ae8f42..b09f5b32 100644 --- a/apps/frontend/src/components/volunteerDashboard/MaintenanceChecklistPopup.tsx +++ b/apps/frontend/src/components/volunteerDashboard/MaintenanceChecklistPopup.tsx @@ -6,7 +6,6 @@ import DialogContentText from '@mui/material/DialogContentText'; import DialogTitle from '@mui/material/DialogTitle'; import { useState } from 'react'; import Box from '@mui/material/Box'; -import InputLabel from '@mui/material/InputLabel'; import MenuItem from '@mui/material/MenuItem'; import FormControl from '@mui/material/FormControl'; import Select, { SelectChangeEvent } from '@mui/material/Select'; From 474b61bd226c8225fca5f601bf869951dac2b32a Mon Sep 17 00:00:00 2001 From: ItsEricSun Date: Tue, 24 Sep 2024 10:48:48 -0400 Subject: [PATCH 6/6] fix code formatting --- .../MaintenanceChecklistPopup.tsx | 46 +++++++++++++++++-- 1 file changed, 41 insertions(+), 5 deletions(-) diff --git a/apps/frontend/src/components/volunteerDashboard/MaintenanceChecklistPopup.tsx b/apps/frontend/src/components/volunteerDashboard/MaintenanceChecklistPopup.tsx index b09f5b32..f80ba70c 100644 --- a/apps/frontend/src/components/volunteerDashboard/MaintenanceChecklistPopup.tsx +++ b/apps/frontend/src/components/volunteerDashboard/MaintenanceChecklistPopup.tsx @@ -49,7 +49,16 @@ export default function MaintenanceChecklistPopup({ > - Maintenance Visit Checklist + + Maintenance Visit Checklist + @@ -58,7 +67,15 @@ export default function MaintenanceChecklistPopup({ - + Select the site you'd like to see a checklist for @@ -73,7 +90,11 @@ export default function MaintenanceChecklistPopup({ } return selected; }} - sx={{fontFamily: 'Montserrat', fontSize: '20px', fontWeight: '400'}} + sx={{ + fontFamily: 'Montserrat', + fontSize: '20px', + fontWeight: '400', + }} MenuProps={{ PaperProps: { sx: { @@ -95,8 +116,23 @@ export default function MaintenanceChecklistPopup({ - - + + );