Renamed the admin type to corporate
This commit is contained in:
@@ -103,10 +103,10 @@ export default function OwnerDashboard({user}: Props) {
|
||||
<BsArrowLeft className="text-xl" />
|
||||
<span>Back</span>
|
||||
</div>
|
||||
<h2 className="text-2xl font-semibold">Corporate ({users.filter((x) => x.type === "admin").length})</h2>
|
||||
<h2 className="text-2xl font-semibold">Corporate ({users.filter((x) => x.type === "corporate").length})</h2>
|
||||
</div>
|
||||
|
||||
<UserList user={user} filter={(x) => x.type === "admin"} />
|
||||
<UserList user={user} filter={(x) => x.type === "corporate"} />
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -131,7 +131,7 @@ export default function OwnerDashboard({user}: Props) {
|
||||
};
|
||||
|
||||
const InactiveCorporateList = () => {
|
||||
const filter = (x: User) => x.type === "admin" && (x.isDisabled || moment().isAfter(x.subscriptionExpirationDate));
|
||||
const filter = (x: User) => x.type === "corporate" && (x.isDisabled || moment().isAfter(x.subscriptionExpirationDate));
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -177,7 +177,7 @@ export default function OwnerDashboard({user}: Props) {
|
||||
<BsPersonFillGear className="text-mti-purple-light text-6xl" />
|
||||
<span className="flex flex-col gap-1 items-center text-xl">
|
||||
<span className="text-lg">Corporate</span>
|
||||
<span className="font-semibold text-mti-purple">{users.filter((x) => x.type === "admin").length}</span>
|
||||
<span className="font-semibold text-mti-purple">{users.filter((x) => x.type === "corporate").length}</span>
|
||||
</span>
|
||||
</div>
|
||||
<div className="bg-white rounded-xl shadow p-4 flex flex-col gap-4 items-center w-52 h-52 justify-center cursor-pointer hover:shadow-xl transition ease-in-out duration-300">
|
||||
@@ -207,7 +207,7 @@ export default function OwnerDashboard({user}: Props) {
|
||||
<span className="flex flex-col gap-1 items-center text-xl">
|
||||
<span className="text-lg text-center">Inactive Corporate</span>
|
||||
<span className="font-semibold text-mti-rose">
|
||||
{users.filter((x) => x.type === "admin" && (x.isDisabled || moment().isAfter(x.subscriptionExpirationDate))).length}
|
||||
{users.filter((x) => x.type === "corporate" && (x.isDisabled || moment().isAfter(x.subscriptionExpirationDate))).length}
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
@@ -229,7 +229,7 @@ export default function OwnerDashboard({user}: Props) {
|
||||
<span className="p-4">Latest corporate</span>
|
||||
<div className="flex flex-col items-start h-96 overflow-scroll scrollbar-hide">
|
||||
{users
|
||||
.filter((x) => x.type === "admin")
|
||||
.filter((x) => x.type === "corporate")
|
||||
.sort((a, b) => dateSorter(a, b, "asc", "registrationDate"))
|
||||
.map((x) => (
|
||||
<UserDisplay key={x.id} {...x} />
|
||||
@@ -240,7 +240,7 @@ export default function OwnerDashboard({user}: Props) {
|
||||
<span className="p-4">Disabled Corporate</span>
|
||||
<div className="flex flex-col items-start h-96 overflow-scroll scrollbar-hide">
|
||||
{users
|
||||
.filter((x) => x.type === "admin" && x.isDisabled)
|
||||
.filter((x) => x.type === "corporate" && x.isDisabled)
|
||||
.map((x) => (
|
||||
<UserDisplay key={x.id} {...x} />
|
||||
))}
|
||||
@@ -282,7 +282,7 @@ export default function OwnerDashboard({user}: Props) {
|
||||
{users
|
||||
.filter(
|
||||
(x) =>
|
||||
x.type === "admin" &&
|
||||
x.type === "corporate" &&
|
||||
x.subscriptionExpirationDate &&
|
||||
moment().isAfter(moment(x.subscriptionExpirationDate).subtract(30, "days")),
|
||||
)
|
||||
@@ -307,9 +307,9 @@ export default function OwnerDashboard({user}: Props) {
|
||||
if (shouldReload) reload();
|
||||
}}
|
||||
onViewStudents={
|
||||
selectedUser.type === "admin" || selectedUser.type === "teacher" ? () => setPage("students") : undefined
|
||||
selectedUser.type === "corporate" || selectedUser.type === "teacher" ? () => setPage("students") : undefined
|
||||
}
|
||||
onViewTeachers={selectedUser.type === "admin" ? () => setPage("teachers") : undefined}
|
||||
onViewTeachers={selectedUser.type === "corporate" ? () => setPage("teachers") : undefined}
|
||||
{...selectedUser}
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user