|
|
@ -10,9 +10,10 @@ import { PlusIcon } from '@heroicons/react/20/solid';
|
|
|
|
import { TrashIcon } from '@heroicons/react/24/outline';
|
|
|
|
import { TrashIcon } from '@heroicons/react/24/outline';
|
|
|
|
import { Button } from '@tih/ui';
|
|
|
|
import { Button } from '@tih/ui';
|
|
|
|
|
|
|
|
|
|
|
|
import FormSelect from './FormSelect';
|
|
|
|
import FormMonthYearPicker from './components/FormMonthYearPicker';
|
|
|
|
import FormTextArea from './FormTextArea';
|
|
|
|
import FormSelect from './components/FormSelect';
|
|
|
|
import FormTextInput from './FormTextInput';
|
|
|
|
import FormTextArea from './components/FormTextArea';
|
|
|
|
|
|
|
|
import FormTextInput from './components/FormTextInput';
|
|
|
|
import {
|
|
|
|
import {
|
|
|
|
companyOptions,
|
|
|
|
companyOptions,
|
|
|
|
internshipCycleOptions,
|
|
|
|
internshipCycleOptions,
|
|
|
@ -20,7 +21,7 @@ import {
|
|
|
|
titleOptions,
|
|
|
|
titleOptions,
|
|
|
|
yearOptions,
|
|
|
|
yearOptions,
|
|
|
|
} from '../constants';
|
|
|
|
} from '../constants';
|
|
|
|
import type { FullTimeOfferFormData, InternshipOfferFormData } from '../types';
|
|
|
|
import type { OfferDetailsFormData } from '../types';
|
|
|
|
import { JobType } from '../types';
|
|
|
|
import { JobType } from '../types';
|
|
|
|
import { CURRENCY_OPTIONS } from '../util/currency/CurrencyEnum';
|
|
|
|
import { CURRENCY_OPTIONS } from '../util/currency/CurrencyEnum';
|
|
|
|
|
|
|
|
|
|
|
@ -34,7 +35,7 @@ function FullTimeOfferDetailsForm({
|
|
|
|
remove,
|
|
|
|
remove,
|
|
|
|
}: FullTimeOfferDetailsFormProps) {
|
|
|
|
}: FullTimeOfferDetailsFormProps) {
|
|
|
|
const { register } = useFormContext<{
|
|
|
|
const { register } = useFormContext<{
|
|
|
|
offers: Array<FullTimeOfferFormData>;
|
|
|
|
offers: Array<OfferDetailsFormData>;
|
|
|
|
}>();
|
|
|
|
}>();
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
@ -81,10 +82,7 @@ function FullTimeOfferDetailsForm({
|
|
|
|
required={true}
|
|
|
|
required={true}
|
|
|
|
{...register(`offers.${index}.location`, { required: true })}
|
|
|
|
{...register(`offers.${index}.location`, { required: true })}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
<FormTextInput
|
|
|
|
<FormMonthYearPicker
|
|
|
|
label="Month Received"
|
|
|
|
|
|
|
|
placeholder="MMM/YYYY"
|
|
|
|
|
|
|
|
required={true}
|
|
|
|
|
|
|
|
{...register(`offers.${index}.monthYearReceived`, { required: true })}
|
|
|
|
{...register(`offers.${index}.monthYearReceived`, { required: true })}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -121,7 +119,9 @@ function FullTimeOfferDetailsForm({
|
|
|
|
isLabelHidden={true}
|
|
|
|
isLabelHidden={true}
|
|
|
|
label="Currency"
|
|
|
|
label="Currency"
|
|
|
|
options={CURRENCY_OPTIONS}
|
|
|
|
options={CURRENCY_OPTIONS}
|
|
|
|
{...register(`offers.${index}.job.base.currency`)}
|
|
|
|
{...register(`offers.${index}.job.base.currency`, {
|
|
|
|
|
|
|
|
required: true,
|
|
|
|
|
|
|
|
})}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
endAddOnType="element"
|
|
|
|
endAddOnType="element"
|
|
|
@ -131,7 +131,7 @@ function FullTimeOfferDetailsForm({
|
|
|
|
startAddOn="$"
|
|
|
|
startAddOn="$"
|
|
|
|
startAddOnType="label"
|
|
|
|
startAddOnType="label"
|
|
|
|
type="number"
|
|
|
|
type="number"
|
|
|
|
{...register(`offers.${index}.job.base.value`)}
|
|
|
|
{...register(`offers.${index}.job.base.value`, { required: true })}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
<FormTextInput
|
|
|
|
<FormTextInput
|
|
|
|
endAddOn={
|
|
|
|
endAddOn={
|
|
|
@ -140,7 +140,9 @@ function FullTimeOfferDetailsForm({
|
|
|
|
isLabelHidden={true}
|
|
|
|
isLabelHidden={true}
|
|
|
|
label="Currency"
|
|
|
|
label="Currency"
|
|
|
|
options={CURRENCY_OPTIONS}
|
|
|
|
options={CURRENCY_OPTIONS}
|
|
|
|
{...register(`offers.${index}.job.bonus.currency`)}
|
|
|
|
{...register(`offers.${index}.job.bonus.currency`, {
|
|
|
|
|
|
|
|
required: true,
|
|
|
|
|
|
|
|
})}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
endAddOnType="element"
|
|
|
|
endAddOnType="element"
|
|
|
@ -150,7 +152,7 @@ function FullTimeOfferDetailsForm({
|
|
|
|
startAddOn="$"
|
|
|
|
startAddOn="$"
|
|
|
|
startAddOnType="label"
|
|
|
|
startAddOnType="label"
|
|
|
|
type="number"
|
|
|
|
type="number"
|
|
|
|
{...register(`offers.${index}.job.bonus.value`)}
|
|
|
|
{...register(`offers.${index}.job.bonus.value`, { required: true })}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className="mb-5 grid grid-cols-2 space-x-3">
|
|
|
|
<div className="mb-5 grid grid-cols-2 space-x-3">
|
|
|
@ -161,7 +163,9 @@ function FullTimeOfferDetailsForm({
|
|
|
|
isLabelHidden={true}
|
|
|
|
isLabelHidden={true}
|
|
|
|
label="Currency"
|
|
|
|
label="Currency"
|
|
|
|
options={CURRENCY_OPTIONS}
|
|
|
|
options={CURRENCY_OPTIONS}
|
|
|
|
{...register(`offers.${index}.job.stocks.currency`)}
|
|
|
|
{...register(`offers.${index}.job.stocks.currency`, {
|
|
|
|
|
|
|
|
required: true,
|
|
|
|
|
|
|
|
})}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
endAddOnType="element"
|
|
|
|
endAddOnType="element"
|
|
|
@ -171,7 +175,7 @@ function FullTimeOfferDetailsForm({
|
|
|
|
startAddOn="$"
|
|
|
|
startAddOn="$"
|
|
|
|
startAddOnType="label"
|
|
|
|
startAddOnType="label"
|
|
|
|
type="number"
|
|
|
|
type="number"
|
|
|
|
{...register(`offers.${index}.job.stocks.value`)}
|
|
|
|
{...register(`offers.${index}.job.stocks.value`, { required: true })}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className="mb-5">
|
|
|
|
<div className="mb-5">
|
|
|
@ -251,7 +255,7 @@ function InternshipOfferDetailsForm({
|
|
|
|
remove,
|
|
|
|
remove,
|
|
|
|
}: InternshipOfferDetailsFormProps) {
|
|
|
|
}: InternshipOfferDetailsFormProps) {
|
|
|
|
const { register } = useFormContext<{
|
|
|
|
const { register } = useFormContext<{
|
|
|
|
offers: Array<InternshipOfferFormData>;
|
|
|
|
offers: Array<OfferDetailsFormData>;
|
|
|
|
}>();
|
|
|
|
}>();
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
@ -262,13 +266,19 @@ function InternshipOfferDetailsForm({
|
|
|
|
label="Title"
|
|
|
|
label="Title"
|
|
|
|
options={titleOptions}
|
|
|
|
options={titleOptions}
|
|
|
|
required={true}
|
|
|
|
required={true}
|
|
|
|
{...register(`offers.${index}.job.title`)}
|
|
|
|
{...register(`offers.${index}.job.title`, {
|
|
|
|
|
|
|
|
minLength: 1,
|
|
|
|
|
|
|
|
required: true,
|
|
|
|
|
|
|
|
})}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
<FormTextInput
|
|
|
|
<FormTextInput
|
|
|
|
label="Focus / Specialization"
|
|
|
|
label="Focus / Specialization"
|
|
|
|
placeholder="e.g. Front End"
|
|
|
|
placeholder="e.g. Front End"
|
|
|
|
required={true}
|
|
|
|
required={true}
|
|
|
|
{...register(`offers.${index}.job.specialization`)}
|
|
|
|
{...register(`offers.${index}.job.specialization`, {
|
|
|
|
|
|
|
|
minLength: 1,
|
|
|
|
|
|
|
|
required: true,
|
|
|
|
|
|
|
|
})}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className="mb-5 grid grid-cols-2 space-x-3">
|
|
|
|
<div className="mb-5 grid grid-cols-2 space-x-3">
|
|
|
@ -289,13 +299,7 @@ function InternshipOfferDetailsForm({
|
|
|
|
{...register(`offers.${index}.location`)}
|
|
|
|
{...register(`offers.${index}.location`)}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className="mb-5 grid grid-cols-3 space-x-3">
|
|
|
|
<div className="mb-5 grid grid-cols-2 space-x-3">
|
|
|
|
<FormTextInput
|
|
|
|
|
|
|
|
label="Date Received"
|
|
|
|
|
|
|
|
placeholder="MMM/YYYY"
|
|
|
|
|
|
|
|
required={true}
|
|
|
|
|
|
|
|
{...register(`offers.${index}.monthYearReceived`)}
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
<FormSelect
|
|
|
|
<FormSelect
|
|
|
|
display="block"
|
|
|
|
display="block"
|
|
|
|
label="Internship Cycle"
|
|
|
|
label="Internship Cycle"
|
|
|
@ -313,6 +317,12 @@ function InternshipOfferDetailsForm({
|
|
|
|
{...register(`offers.${index}.job.startYear`)}
|
|
|
|
{...register(`offers.${index}.job.startYear`)}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div className="mb-5 flex items-center space-x-9">
|
|
|
|
|
|
|
|
<p className="text-sm">Date received:</p>
|
|
|
|
|
|
|
|
<FormMonthYearPicker
|
|
|
|
|
|
|
|
{...register(`offers.${index}.monthYearReceived`, { required: true })}
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div className="mb-5">
|
|
|
|
<div className="mb-5">
|
|
|
|
<FormTextInput
|
|
|
|
<FormTextInput
|
|
|
|
endAddOn={
|
|
|
|
endAddOn={
|
|
|
|