Revert "Changed Comercial labels to Corporate"

This reverts commit 9c8d7988c5.
This commit is contained in:
Joao Ramos
2023-12-08 14:55:16 +00:00
parent d46f92edb2
commit dfbbf0456d
3 changed files with 12 additions and 12 deletions

View File

@@ -24,7 +24,7 @@ export default function DemographicInformationInput({user, mutateUser}: Props) {
const [position, setPosition] = useState<string>(); const [position, setPosition] = useState<string>();
const [isLoading, setIsLoading] = useState(false); const [isLoading, setIsLoading] = useState(false);
const [corporateName, setCorporateName] = useState<string>(); const [companyName, setCompanyName] = useState<string>();
const [commercialRegistration, setCommercialRegistration] = useState<string>(); const [commercialRegistration, setCommercialRegistration] = useState<string>();
const save = (e?: FormEvent) => { const save = (e?: FormEvent) => {
@@ -40,7 +40,7 @@ export default function DemographicInformationInput({user, mutateUser}: Props) {
employment: user.type === "corporate" ? undefined : employment, employment: user.type === "corporate" ? undefined : employment,
position: user.type === "corporate" ? position : undefined, 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)) .then((response) => mutateUser((response.data as {user: User}).user))
.catch(() => { .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}> <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" && ( {user.type === "agent" && (
<div className="w-full flex gap-8"> <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 <Input
type="text" type="text"
onChange={setCommercialRegistration} onChange={setCommercialRegistration}
@@ -157,7 +157,7 @@ export default function DemographicInformationInput({user, mutateUser}: Props) {
!phone || !phone ||
!gender || !gender ||
(user.type === "corporate" ? !position : !employment) || (user.type === "corporate" ? !position : !employment) ||
(user.type === "agent" ? !corporateName || !commercialRegistration : false) (user.type === "agent" ? !companyName || !commercialRegistration : false)
}> }>
{!isLoading && "Save information"} {!isLoading && "Save information"}
{isLoading && ( {isLoading && (

View File

@@ -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"> <div className="grid grid-cols-1 md:grid-cols-2 gap-8 w-full">
<Input <Input
label="Corporate Name" label="Company Name"
type="text" type="text"
name="companyName" name="companyName"
onChange={setCompanyName} onChange={setCompanyName}
placeholder="Enter corporate name" placeholder="Enter company name"
defaultValue={companyName} defaultValue={companyName}
required required
/> />
@@ -159,7 +159,7 @@ const UserCard = ({user, loggedInUser, onClose, onViewStudents, onViewTeachers,
type="text" type="text"
name="commercialRegistration" name="commercialRegistration"
onChange={setCommercialRegistration} onChange={setCommercialRegistration}
placeholder="Enter commercial registration" placeholder="Enter company name"
defaultValue={commercialRegistration} defaultValue={commercialRegistration}
required 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"> <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8 w-full">
<Input <Input
label="Corporate Name" label="Company Name"
type="text" type="text"
name="companyName" name="companyName"
onChange={setCompanyName} onChange={setCompanyName}
placeholder="Enter corporate name" placeholder="Enter company name"
defaultValue={companyName} defaultValue={companyName}
/> />
<Input <Input

View File

@@ -214,11 +214,11 @@ export default function Home() {
{user.type === "agent" && ( {user.type === "agent" && (
<div className="grid grid-cols-1 md:grid-cols-2 gap-8 w-full"> <div className="grid grid-cols-1 md:grid-cols-2 gap-8 w-full">
<Input <Input
label="Corporate Name" label="Company Name"
type="text" type="text"
name="companyName" name="companyName"
onChange={() => null} onChange={() => null}
placeholder="Enter corporate name" placeholder="Enter company name"
defaultValue={user.agentInformation.companyName} defaultValue={user.agentInformation.companyName}
disabled disabled
/> />
@@ -227,7 +227,7 @@ export default function Home() {
type="text" type="text"
name="commercialRegistration" name="commercialRegistration"
onChange={() => null} onChange={() => null}
placeholder="Enter commercial registration" placeholder="Enter company name"
defaultValue={user.agentInformation.commercialRegistration} defaultValue={user.agentInformation.commercialRegistration}
disabled disabled
/> />