Updated the profile page a bit to accommodate recent changes
This commit is contained in:
@@ -82,7 +82,7 @@ function UserProfile({user, mutateUser}: Props) {
|
||||
const [commercialRegistration, setCommercialRegistration] = useState<string | undefined>(
|
||||
user.type === "agent" ? user.agentInformation?.commercialRegistration : undefined,
|
||||
);
|
||||
const [timezone, setTimezone] = useState<string>(user.demographicInformation?.timezone || 'UTC');
|
||||
const [timezone, setTimezone] = useState<string>(user.demographicInformation?.timezone || "UTC");
|
||||
const {groups} = useGroups();
|
||||
const {users} = useUsers();
|
||||
|
||||
@@ -248,7 +248,7 @@ function UserProfile({user, mutateUser}: Props) {
|
||||
);
|
||||
|
||||
const TimezoneInput = () => (
|
||||
<div className="flex flex-col gap-3 w-1/2">
|
||||
<div className="flex flex-col gap-3 w-full">
|
||||
<label className="font-normal text-base text-mti-gray-dim">Timezone</label>
|
||||
<TimezoneSelect value={timezone} onChange={setTimezone} />
|
||||
</div>
|
||||
@@ -293,8 +293,15 @@ function UserProfile({user, mutateUser}: Props) {
|
||||
/>
|
||||
</DoubleColumnRow>
|
||||
<PasswordInput />
|
||||
{user.type === "agent" && <AgentInformationInput />}
|
||||
|
||||
{user.type === "student" && (
|
||||
<DoubleColumnRow>
|
||||
<CountryInput />
|
||||
<PhoneInput />
|
||||
</DoubleColumnRow>
|
||||
|
||||
{user.type === "student" ? (
|
||||
<DoubleColumnRow>
|
||||
<Input
|
||||
type="text"
|
||||
name="passport_id"
|
||||
@@ -304,16 +311,11 @@ function UserProfile({user, mutateUser}: Props) {
|
||||
value={passport_id}
|
||||
required
|
||||
/>
|
||||
)}
|
||||
{user.type === "agent" && <AgentInformationInput />}
|
||||
|
||||
<DoubleColumnRow>
|
||||
<CountryInput />
|
||||
<PhoneInput />
|
||||
</DoubleColumnRow>
|
||||
<DoubleColumnRow>
|
||||
<TimezoneInput />
|
||||
</DoubleColumnRow>
|
||||
) : (
|
||||
<TimezoneInput />
|
||||
)}
|
||||
|
||||
<Divider />
|
||||
|
||||
|
||||
Reference in New Issue
Block a user