Changed from employment to position for Corporate accounts
This commit is contained in:
@@ -63,6 +63,7 @@ export default function Home() {
|
||||
const [phone, setPhone] = useState<string>();
|
||||
const [gender, setGender] = useState<Gender>();
|
||||
const [employment, setEmployment] = useState<EmploymentStatus>();
|
||||
const [position, setPosition] = useState<string>();
|
||||
|
||||
const profilePictureInput = useRef(null);
|
||||
|
||||
@@ -86,7 +87,8 @@ export default function Home() {
|
||||
setCountry(user.demographicInformation?.country);
|
||||
setPhone(user.demographicInformation?.phone);
|
||||
setGender(user.demographicInformation?.gender);
|
||||
setEmployment(user.demographicInformation?.employment);
|
||||
setEmployment(user.type === "corporate" ? undefined : user.demographicInformation?.employment);
|
||||
setPosition(user.type === "corporate" ? user.demographicInformation?.position : undefined);
|
||||
}
|
||||
}, [user]);
|
||||
|
||||
@@ -135,7 +137,8 @@ export default function Home() {
|
||||
demographicInformation: {
|
||||
phone,
|
||||
country,
|
||||
employment,
|
||||
employment: user?.type === "corporate" ? undefined : employment,
|
||||
position: user?.type === "corporate" ? position : undefined,
|
||||
gender,
|
||||
},
|
||||
});
|
||||
@@ -247,30 +250,43 @@ export default function Home() {
|
||||
/>
|
||||
</div>
|
||||
<div className="flex flex-col md:flex-row gap-8 w-full">
|
||||
<div className="relative flex flex-col gap-3 w-full">
|
||||
<label className="font-normal text-base text-mti-gray-dim">Employment Status *</label>
|
||||
<RadioGroup
|
||||
value={employment}
|
||||
onChange={setEmployment}
|
||||
className="grid grid-cols-2 items-center gap-4 place-items-center">
|
||||
{EMPLOYMENT_STATUS.map(({status, label}) => (
|
||||
<RadioGroup.Option value={status} key={status}>
|
||||
{({checked}) => (
|
||||
<span
|
||||
className={clsx(
|
||||
"px-6 py-4 w-40 md:w-48 flex justify-center text-sm font-normal rounded-full border focus:outline-none cursor-pointer",
|
||||
"transition duration-300 ease-in-out",
|
||||
!checked
|
||||
? "bg-white border-mti-gray-platinum"
|
||||
: "bg-mti-purple-light border-mti-purple-dark text-white",
|
||||
)}>
|
||||
{label}
|
||||
</span>
|
||||
)}
|
||||
</RadioGroup.Option>
|
||||
))}
|
||||
</RadioGroup>
|
||||
</div>
|
||||
{user.type === "corporate" && (
|
||||
<Input
|
||||
name="position"
|
||||
onChange={setPosition}
|
||||
defaultValue={position}
|
||||
type="text"
|
||||
label="Position"
|
||||
placeholder="CEO, Head of Marketing..."
|
||||
required
|
||||
/>
|
||||
)}
|
||||
{user.type !== "corporate" && (
|
||||
<div className="relative flex flex-col gap-3 w-full">
|
||||
<label className="font-normal text-base text-mti-gray-dim">Employment Status *</label>
|
||||
<RadioGroup
|
||||
value={employment}
|
||||
onChange={setEmployment}
|
||||
className="grid grid-cols-2 items-center gap-4 place-items-center">
|
||||
{EMPLOYMENT_STATUS.map(({status, label}) => (
|
||||
<RadioGroup.Option value={status} key={status}>
|
||||
{({checked}) => (
|
||||
<span
|
||||
className={clsx(
|
||||
"px-6 py-4 w-40 md:w-48 flex justify-center text-sm font-normal rounded-full border focus:outline-none cursor-pointer",
|
||||
"transition duration-300 ease-in-out",
|
||||
!checked
|
||||
? "bg-white border-mti-gray-platinum"
|
||||
: "bg-mti-purple-light border-mti-purple-dark text-white",
|
||||
)}>
|
||||
{label}
|
||||
</span>
|
||||
)}
|
||||
</RadioGroup.Option>
|
||||
))}
|
||||
</RadioGroup>
|
||||
</div>
|
||||
)}
|
||||
<div className="flex flex-col gap-8 w-full">
|
||||
<div className="relative flex flex-col gap-3 w-full">
|
||||
<label className="font-normal text-base text-mti-gray-dim">Gender *</label>
|
||||
|
||||
Reference in New Issue
Block a user