diff --git a/apps/portal/src/components/offers/constants.ts b/apps/portal/src/components/offers/constants.ts new file mode 100644 index 00000000..09e11240 --- /dev/null +++ b/apps/portal/src/components/offers/constants.ts @@ -0,0 +1,120 @@ +// TODO: use enums +export const titleOptions = [ + { + label: 'Software engineer', + value: 'Software engineer', + }, + { + label: 'Frontend engineer', + value: 'Frontend engineer', + }, + { + label: 'Backend engineer', + value: 'Backend engineer', + }, + { + label: 'Full-stack engineer', + value: 'Full-stack engineer', + }, +]; + +export const currencyOptions = [ + { + label: 'USD', + value: 'USD', + }, + { + label: 'SGD', + value: 'SGD', + }, + { + label: 'EUR', + value: 'EUR', + }, +]; + +export const companyOptions = [ + { + label: 'Shopee', + value: 'id-abc123', + }, +]; + +export const locationOptions = [ + { + label: 'Singapore, Singapore', + value: 'Singapore, Singapore', + }, +]; + +export const internshipCycleOptions = [ + { + label: 'Summer', + value: 'Summer', + }, + { + label: 'Winter', + value: 'Winter', + }, + { + label: 'Spring', + value: 'Spring', + }, + { + label: 'Fall', + value: 'Fall', + }, + { + label: 'Full-year', + value: 'Full-year', + }, +]; + +export const yearOptions = [ + { + label: '2021', + value: '2021', + }, + { + label: '2022', + value: '2022', + }, + { + label: '2023', + value: '2023', + }, + { + label: '2024', + value: '2024', + }, +]; + +export const educationLevelOptions = [ + { + label: 'Bachelor', + value: 'Bachelor', + }, + { + label: 'Masters', + value: 'Masters', + }, + { + label: 'Doctorate', + value: 'Doctorate', + }, +]; + +export const educationFieldOptions = [ + { + label: 'Computer Science', + value: 'Computer Science', + }, + { + label: 'Information Security', + value: 'Information Security', + }, + { + label: 'Business Analytics', + value: 'Business Analytics', + }, +]; diff --git a/apps/portal/src/components/offers/forms/BackgroundForm.tsx b/apps/portal/src/components/offers/forms/BackgroundForm.tsx index 447fddf8..94e478e9 100644 --- a/apps/portal/src/components/offers/forms/BackgroundForm.tsx +++ b/apps/portal/src/components/offers/forms/BackgroundForm.tsx @@ -7,9 +7,11 @@ import FormTextInput from './FormTextInput'; import { companyOptions, currencyOptions, + educationFieldOptions, + educationLevelOptions, locationOptions, titleOptions, -} from './OfferDetailsForm'; +} from '../constants'; function YoeSection() { const { register } = useFormContext(); @@ -187,7 +189,9 @@ function InternshipJobFields() { } function CurrentJobSection() { - const { register, getValues } = useFormContext(); + const { register, watch } = useFormContext(); + const watchJobType = watch('background.experience.jobType', 'FULLTIME'); + return ( <>