diff --git a/apps/portal/src/components/offers/OffersNavigation.ts b/apps/portal/src/components/offers/OffersNavigation.ts index 8e020e4c..e3746453 100644 --- a/apps/portal/src/components/offers/OffersNavigation.ts +++ b/apps/portal/src/components/offers/OffersNavigation.ts @@ -2,7 +2,7 @@ import type { ProductNavigationItems } from '~/components/global/ProductNavigati const navigation: ProductNavigationItems = [ { href: '/offers', name: 'Home' }, - { href: '/submit', name: 'Benchmark your offer' }, + { href: '/offers/submit', name: 'Benchmark your offer' }, ]; const config = { diff --git a/apps/portal/src/components/offers/OffersTitle.tsx b/apps/portal/src/components/offers/OffersTitle.tsx index a28d1a69..e114e00d 100644 --- a/apps/portal/src/components/offers/OffersTitle.tsx +++ b/apps/portal/src/components/offers/OffersTitle.tsx @@ -1,3 +1,14 @@ export default function OffersTitle() { - return

Offers Research

; + return ( + <> +
+

+ Technical Handbook Offers Repo +

+
+
+ Benchmark your offers and discuss them with the community +
+ + ); } diff --git a/apps/portal/src/components/offers/forms/BackgroundForm.tsx b/apps/portal/src/components/offers/forms/BackgroundForm.tsx new file mode 100644 index 00000000..447fddf8 --- /dev/null +++ b/apps/portal/src/components/offers/forms/BackgroundForm.tsx @@ -0,0 +1,309 @@ +import { useFormContext } from 'react-hook-form'; +import { Collapsible, RadioList } from '@tih/ui'; + +import FormRadioList from './FormRadioList'; +import FormSelect from './FormSelect'; +import FormTextInput from './FormTextInput'; +import { + companyOptions, + currencyOptions, + locationOptions, + titleOptions, +} from './OfferDetailsForm'; + +function YoeSection() { + const { register } = useFormContext(); + return ( + <> +
+ Years of Experience (YOE) +
+ +
+
+ +
+
+ +
+ + +
+
+ + +
+
+
+
+ + ); +} + +function FullTimeJobFields() { + const { register } = useFormContext(); + return ( + <> +
+ + +
+
+ + } + endAddOnType="element" + label="Total Compensation (Annual)" + placeholder="0.00" + startAddOn="$" + startAddOnType="label" + type="number" + {...register(`background.experience.totalCompensation.value`)} + /> +
+ +
+ + +
+
+ + +
+
+ + ); +} + +function InternshipJobFields() { + const { register } = useFormContext(); + return ( + <> +
+ + +
+
+ + } + endAddOnType="element" + label="Salary (Monthly)" + placeholder="0.00" + startAddOn="$" + startAddOnType="label" + type="number" + {...register(`background.experience.monthlySalary.value`)} + /> +
+ +
+ + +
+
+ + ); +} + +function CurrentJobSection() { + const { register, getValues } = useFormContext(); + return ( + <> +
+ Current / Previous Job +
+
+
+ + + + +
+ {getValues('background.experience.jobType') === 'Full-time' ? ( + + ) : ( + + )} +
+ + ); +} + +const educationLevelOptions = [ + { + label: 'Bachelor', + value: 'Bachelor', + }, + { + label: 'Masters', + value: 'Masters', + }, + { + label: 'Doctorate', + value: 'Doctorate', + }, +]; + +const fieldOptions = [ + { + label: 'Computer Science', + value: 'Computer Science', + }, + { + label: 'Information Security', + value: 'Information Security', + }, + { + label: 'Business Analytics', + value: 'Business Analytics', + }, +]; + +function EducationSection() { + const { register } = useFormContext(); + return ( + <> +
+ Education +
+
+
+ + +
+ +
+ +
+
+
+ + ); +} + +export default function BackgroundForm() { + return ( +
+
+ Help us better gauge your offers +
+
+ This section is optional, but your background information helps us + benchmark your offers. +
+
+ + + +
+
+ ); +} diff --git a/apps/portal/src/components/offers/forms/FormRadioList.tsx b/apps/portal/src/components/offers/forms/FormRadioList.tsx new file mode 100644 index 00000000..56bbfd51 --- /dev/null +++ b/apps/portal/src/components/offers/forms/FormRadioList.tsx @@ -0,0 +1,24 @@ +import type { ComponentProps } from 'react'; +import { forwardRef } from 'react'; +import { useFormContext } from 'react-hook-form'; +import { RadioList } from '@tih/ui'; + +type RadioListProps = ComponentProps; + +type FormRadioListProps = Omit; + +function FormRadioListWithRef(props: FormRadioListProps) { + const { name, ...rest } = props; + const { setValue } = useFormContext(); + return ( + setValue(name || '', val)} + /> + ); +} + +const FormRadioList = forwardRef(FormRadioListWithRef); + +export default FormRadioList; diff --git a/apps/portal/src/components/offers/forms/FormSelect.tsx b/apps/portal/src/components/offers/forms/FormSelect.tsx new file mode 100644 index 00000000..d7190af2 --- /dev/null +++ b/apps/portal/src/components/offers/forms/FormSelect.tsx @@ -0,0 +1,27 @@ +import type { ComponentProps, ForwardedRef } from 'react'; +import { forwardRef } from 'react'; +import { useFormContext } from 'react-hook-form'; +import { Select } from '@tih/ui'; + +type SelectProps = ComponentProps; + +type FormSelectProps = Omit; + +function FormSelectWithRef( + props: FormSelectProps, + ref?: ForwardedRef, +) { + const { name } = props; + const { setValue } = useFormContext(); + return ( +