Skip to content

Commit

Permalink
Update AfterLogin.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
FeimeiChen committed Apr 17, 2024
1 parent 71bc9ba commit 09399ec
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions ui/src/app/(index)/_components/AfterLogin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Role from '@/access/Role';
import Image from 'next/image';
import { KeyRound } from 'lucide-react';
import Link from 'next/link';
import {Button} from '@/components/ui/button';
import { Button } from '@/components/ui/button';

const AfterLogin = ({
currentUser,
Expand Down Expand Up @@ -34,6 +34,7 @@ const AfterLogin = ({
width: 48,
height: 48,
},
role: Role.ADMIN
},
{
title: 'Memberships',
Expand All @@ -45,7 +46,8 @@ const AfterLogin = ({
width:54,
height:48,
},
number:numberOfMemberships
number:numberOfMemberships,
role: Role.UH
},
{
title:'Groupings',
Expand All @@ -58,7 +60,8 @@ const AfterLogin = ({
width:48,
height:48
},
number:numberOfGroupings
number:numberOfGroupings,
role: Role.OWNER
}
]

Expand Down Expand Up @@ -96,12 +99,7 @@ const AfterLogin = ({

<div className="container grid grid-cols-1 md:grid-cols-3 gap-6 md:gap-8 mt-10 mb-10">
{items
.filter((item, index) =>{
if (isAdmin) return true;
else if (isOwner) return index === 1 || index === 2;
else return index === 1;

})
.filter((item) => currentUser.roles.includes(item.role))
.map((item, index)=>(
<div key={index} className="flex flex-col justify-between">
<div>
Expand Down

0 comments on commit 09399ec

Please sign in to comment.