Revert "Changed Comercial labels to Corporate"
This reverts commit 9c8d7988c5.
This commit is contained in:
@@ -24,7 +24,7 @@ export default function DemographicInformationInput({user, mutateUser}: Props) {
|
||||
const [position, setPosition] = useState<string>();
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
|
||||
const [corporateName, setCorporateName] = useState<string>();
|
||||
const [companyName, setCompanyName] = useState<string>();
|
||||
const [commercialRegistration, setCommercialRegistration] = useState<string>();
|
||||
|
||||
const save = (e?: FormEvent) => {
|
||||
@@ -40,7 +40,7 @@ export default function DemographicInformationInput({user, mutateUser}: Props) {
|
||||
employment: user.type === "corporate" ? undefined : employment,
|
||||
position: user.type === "corporate" ? position : undefined,
|
||||
},
|
||||
agentInformation: user.type === "agent" ? {corporateName, commercialRegistration} : undefined,
|
||||
agentInformation: user.type === "agent" ? {companyName, commercialRegistration} : undefined,
|
||||
})
|
||||
.then((response) => mutateUser((response.data as {user: User}).user))
|
||||
.catch(() => {
|
||||
@@ -62,7 +62,7 @@ export default function DemographicInformationInput({user, mutateUser}: Props) {
|
||||
<form className="flex flex-col items-center justify-items-center gap-6 w-full h-full -md:px-4 lg:w-1/2 mb-32" onSubmit={save}>
|
||||
{user.type === "agent" && (
|
||||
<div className="w-full flex gap-8">
|
||||
<Input type="text" onChange={setCorporateName} name="corporateName" label="Corporate Name" required />
|
||||
<Input type="text" onChange={setCompanyName} name="companyName" label="Company Name" required />
|
||||
<Input
|
||||
type="text"
|
||||
onChange={setCommercialRegistration}
|
||||
@@ -157,7 +157,7 @@ export default function DemographicInformationInput({user, mutateUser}: Props) {
|
||||
!phone ||
|
||||
!gender ||
|
||||
(user.type === "corporate" ? !position : !employment) ||
|
||||
(user.type === "agent" ? !corporateName || !commercialRegistration : false)
|
||||
(user.type === "agent" ? !companyName || !commercialRegistration : false)
|
||||
}>
|
||||
{!isLoading && "Save information"}
|
||||
{isLoading && (
|
||||
|
||||
@@ -146,11 +146,11 @@ const UserCard = ({user, loggedInUser, onClose, onViewStudents, onViewTeachers,
|
||||
<>
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-8 w-full">
|
||||
<Input
|
||||
label="Corporate Name"
|
||||
label="Company Name"
|
||||
type="text"
|
||||
name="companyName"
|
||||
onChange={setCompanyName}
|
||||
placeholder="Enter corporate name"
|
||||
placeholder="Enter company name"
|
||||
defaultValue={companyName}
|
||||
required
|
||||
/>
|
||||
@@ -159,7 +159,7 @@ const UserCard = ({user, loggedInUser, onClose, onViewStudents, onViewTeachers,
|
||||
type="text"
|
||||
name="commercialRegistration"
|
||||
onChange={setCommercialRegistration}
|
||||
placeholder="Enter commercial registration"
|
||||
placeholder="Enter company name"
|
||||
defaultValue={commercialRegistration}
|
||||
required
|
||||
/>
|
||||
@@ -171,11 +171,11 @@ const UserCard = ({user, loggedInUser, onClose, onViewStudents, onViewTeachers,
|
||||
<>
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8 w-full">
|
||||
<Input
|
||||
label="Corporate Name"
|
||||
label="Company Name"
|
||||
type="text"
|
||||
name="companyName"
|
||||
onChange={setCompanyName}
|
||||
placeholder="Enter corporate name"
|
||||
placeholder="Enter company name"
|
||||
defaultValue={companyName}
|
||||
/>
|
||||
<Input
|
||||
|
||||
@@ -214,11 +214,11 @@ export default function Home() {
|
||||
{user.type === "agent" && (
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-8 w-full">
|
||||
<Input
|
||||
label="Corporate Name"
|
||||
label="Company Name"
|
||||
type="text"
|
||||
name="companyName"
|
||||
onChange={() => null}
|
||||
placeholder="Enter corporate name"
|
||||
placeholder="Enter company name"
|
||||
defaultValue={user.agentInformation.companyName}
|
||||
disabled
|
||||
/>
|
||||
@@ -227,7 +227,7 @@ export default function Home() {
|
||||
type="text"
|
||||
name="commercialRegistration"
|
||||
onChange={() => null}
|
||||
placeholder="Enter commercial registration"
|
||||
placeholder="Enter company name"
|
||||
defaultValue={user.agentInformation.commercialRegistration}
|
||||
disabled
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user