From 3878d4761e198917e4b1cc50a3db5781d2b0ee3e Mon Sep 17 00:00:00 2001 From: Tiago Ribeiro Date: Mon, 27 Nov 2023 13:07:33 +0000 Subject: [PATCH] Made it so the listing of a corporate account shows the name of the corporate instead of the person --- src/dashboards/Admin.tsx | 6 +++++- src/dashboards/Agent.tsx | 6 +++++- src/pages/(admin)/Lists/UserList.tsx | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/dashboards/Admin.tsx b/src/dashboards/Admin.tsx index 784c6d9e..5ba88f5f 100644 --- a/src/dashboards/Admin.tsx +++ b/src/dashboards/Admin.tsx @@ -44,7 +44,11 @@ export default function AdminDashboard({user}: Props) { className="flex w-full p-4 gap-4 items-center hover:bg-mti-purple-ultralight cursor-pointer transition ease-in-out duration-300"> {displayUser.name}
- {displayUser.name} + + {displayUser.type === "corporate" + ? displayUser.corporateInformation?.companyInformation?.name || displayUser.name + : displayUser.name} + {displayUser.email}
diff --git a/src/dashboards/Agent.tsx b/src/dashboards/Agent.tsx index b6dd37a5..0e91ec23 100644 --- a/src/dashboards/Agent.tsx +++ b/src/dashboards/Agent.tsx @@ -57,7 +57,11 @@ export default function AgentDashboard({user}: Props) { className="flex w-full p-4 gap-4 items-center hover:bg-mti-purple-ultralight cursor-pointer transition ease-in-out duration-300"> {displayUser.name}
- {displayUser.name} + + {displayUser.type === "corporate" + ? displayUser.corporateInformation?.companyInformation?.name || displayUser.name + : displayUser.name} + {displayUser.email}
diff --git a/src/pages/(admin)/Lists/UserList.tsx b/src/pages/(admin)/Lists/UserList.tsx index 8aba48a6..790fc686 100644 --- a/src/pages/(admin)/Lists/UserList.tsx +++ b/src/pages/(admin)/Lists/UserList.tsx @@ -288,7 +288,7 @@ export default function UserList({user, filter}: {user: User; filter?: (user: Us "underline text-mti-purple-light hover:text-mti-purple-dark transition ease-in-out duration-300 cursor-pointer", )} onClick={() => (PERMISSIONS.updateExpiryDate[row.original.type].includes(user.type) ? setSelectedUser(row.original) : null)}> - {getValue()} + {row.original.type === "corporate" ? row.original.corporateInformation?.companyInformation?.name || getValue() : getValue()} ), }),