From 43ce958ac2e8fee6351c681aa9a298045c4aa18d Mon Sep 17 00:00:00 2001 From: nourshoreibah Date: Thu, 30 Jan 2025 15:05:46 -0500 Subject: [PATCH 1/4] Add group sign up box --- .../volunteer/signup/SignUpPage.tsx | 228 +++++++++--------- 1 file changed, 109 insertions(+), 119 deletions(-) diff --git a/apps/frontend/src/components/volunteer/signup/SignUpPage.tsx b/apps/frontend/src/components/volunteer/signup/SignUpPage.tsx index 50d85d35..09182ebd 100644 --- a/apps/frontend/src/components/volunteer/signup/SignUpPage.tsx +++ b/apps/frontend/src/components/volunteer/signup/SignUpPage.tsx @@ -6,6 +6,7 @@ import { VStack, Button, IconButton, + Textarea, } from '@chakra-ui/react'; import { Checkbox } from '@mui/material'; import CloseIcon from '@mui/icons-material/Close'; @@ -26,20 +27,21 @@ interface CheckboxField { interface InputFieldGroup { fields: InputField[]; - type?: 'single' | 'double'; // 'single' for single column, 'double' for double column row + type?: 'single' | 'double'; height: string; width: string; } const personalInfoCheckboxesMap: CheckboxField[] = [ - { - label: 'Signing up as a group representative?', - }, + { label: 'Signing up as a group representative?' }, ]; const personalInfoInputFieldsMap: InputFieldGroup[] = [ { - fields: [{ label: 'First Name', width: '250px'}, { label: 'Last Name', width: '350px' }], + fields: [ + { label: 'First Name', width: '250px' }, + { label: 'Last Name', width: '350px' }, + ], type: 'double', height: '40px', width: '810px', @@ -65,127 +67,142 @@ const personalInfoInputFieldsMap: InputFieldGroup[] = [ ]; const termsAndConditionsCheckboxesMap: CheckboxField[] = [ - { - label: 'I have reviewed the General Safety Guidelines', - }, - { - label: 'I have read and agree to the Terms of Use and Privacy Policy', - }, - { - label: 'I have read and agree to the Release of Liability', - }, + { label: 'I have reviewed the General Safety Guidelines' }, + { label: 'I have read and agree to the Terms of Use and Privacy Policy' }, + { label: 'I have read and agree to the Release of Liability' }, ]; function PersonalInfo() { + const [isGroupRepresentative, setIsGroupRepresentative] = useState(false); + return ( - + {personalInfoCheckboxesMap.map((field, i) => ( - + {field.label} setIsGroupRepresentative(e.target.checked)} sx={{ - color: '#808080', // Grey color for the checkbox when not checked - '&.Mui-checked': { - color: '#808080', // Grey color for the checkbox when checked - }, - '& .MuiSvgIcon-root': { - fontSize: 23, - }, + color: '#808080', + '&.Mui-checked': { color: '#808080' }, + '& .MuiSvgIcon-root': { fontSize: 23 }, padding: '2px', marginLeft: '20px', }} /> ))} - {personalInfoInputFieldsMap.map((group, i) => ( - - {group.type === 'double' ? ( - - {group.fields.map((field, j) => ( - - - {field.label} - - - - ))} - - ) : ( - + + {/* Name Fields */} + + + {personalInfoInputFieldsMap[0].fields.map((field, j) => ( + + {field.label} + + + + ))} + + + + {/* Lower Section */} + + {/* Left Column - Email/Phone/Birth Year */} + + {personalInfoInputFieldsMap.slice(1).map((group, i) => ( + + {group.fields[0].label} - )} + ))} - ))} + + {/* Right Column - Group Members */} + {isGroupRepresentative && ( + + + Group Members + +