diff --git a/frontend/src/components/DonorRegistration.tsx b/frontend/src/components/DonorRegistration.tsx index f1c7567..e0ad75e 100644 --- a/frontend/src/components/DonorRegistration.tsx +++ b/frontend/src/components/DonorRegistration.tsx @@ -15,6 +15,7 @@ export default function DonorRegistration() { const [phone, setPhone] = useState(''); const [bloodGroup, setBloodGroup] = useState(''); const [lastDonated, setLastDonated] = useState(''); + const [sex, setSex] = useState<'male' | 'female' | ''>(''); // Geolocation State const [locating, setLocating] = useState(false); @@ -91,7 +92,8 @@ export default function DonorRegistration() { bloodGroup, coords?.lat ?? null, coords?.lng ?? null, - lastDonated || null + lastDonated || null, + sex || null ); if (data && data.ok) { @@ -126,6 +128,12 @@ export default function DonorRegistration() { { value: 'AB-', label: 'AB-' } ]; + const sexOptions = [ + { value: '', label: '-- Select Sex (Optional) --' }, + { value: 'male', label: 'Male (90 days cooldown)' }, + { value: 'female', label: 'Female (120 days cooldown)' } + ]; + // Disable check: Name, Phone, and Blood Group must be populated const isButtonDisabled = !name.trim() || !phone.trim() || !bloodGroup; @@ -199,6 +207,14 @@ export default function DonorRegistration() { aria-required="true" /> + {/* Sex Selector */} +