Profile screen was crashing
This commit is contained in:
@@ -64,6 +64,8 @@ export default function Home() {
|
|||||||
const [gender, setGender] = useState<Gender>();
|
const [gender, setGender] = useState<Gender>();
|
||||||
const [employment, setEmployment] = useState<EmploymentStatus>();
|
const [employment, setEmployment] = useState<EmploymentStatus>();
|
||||||
const [position, setPosition] = useState<string>();
|
const [position, setPosition] = useState<string>();
|
||||||
|
const [companyName, setCompanyName] = useState<string>("");
|
||||||
|
const [commercialRegistration, setCommercialRegistration] = useState<string>("");
|
||||||
|
|
||||||
const profilePictureInput = useRef(null);
|
const profilePictureInput = useRef(null);
|
||||||
|
|
||||||
@@ -89,6 +91,10 @@ export default function Home() {
|
|||||||
setGender(user.demographicInformation?.gender);
|
setGender(user.demographicInformation?.gender);
|
||||||
setEmployment(user.type === "corporate" ? undefined : user.demographicInformation?.employment);
|
setEmployment(user.type === "corporate" ? undefined : user.demographicInformation?.employment);
|
||||||
setPosition(user.type === "corporate" ? user.demographicInformation?.position : undefined);
|
setPosition(user.type === "corporate" ? user.demographicInformation?.position : undefined);
|
||||||
|
if(user.type === 'agent') {
|
||||||
|
setCompanyName(user.agentInformation?.companyName)
|
||||||
|
setCommercialRegistration(user.agentInformation?.commercialRegistration)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, [user]);
|
}, [user]);
|
||||||
|
|
||||||
@@ -219,7 +225,7 @@ export default function Home() {
|
|||||||
name="companyName"
|
name="companyName"
|
||||||
onChange={() => null}
|
onChange={() => null}
|
||||||
placeholder="Enter corporate name"
|
placeholder="Enter corporate name"
|
||||||
defaultValue={user.agentInformation.companyName}
|
defaultValue={companyName}
|
||||||
disabled
|
disabled
|
||||||
/>
|
/>
|
||||||
<Input
|
<Input
|
||||||
@@ -228,7 +234,7 @@ export default function Home() {
|
|||||||
name="commercialRegistration"
|
name="commercialRegistration"
|
||||||
onChange={() => null}
|
onChange={() => null}
|
||||||
placeholder="Enter commercial registration"
|
placeholder="Enter commercial registration"
|
||||||
defaultValue={user.agentInformation.commercialRegistration}
|
defaultValue={commercialRegistration}
|
||||||
disabled
|
disabled
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user