Skip to content

Commit

Permalink
Fix UI for chips display
Browse files Browse the repository at this point in the history
  • Loading branch information
vivienherq committed Apr 18, 2024
1 parent 6f74134 commit a1a6374
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions frontend/src/components/assignment/AssignmentList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,22 @@ function AssignmentList({ assignments, userRole }: Props) {
className="bg-white shadow-md"
>
<CardHeader className="pb-0">
{assignment.isPublished ? (
<Chip color="success" className="text-white font-bold">
Published
</Chip>
) : (
<Chip>Unpublished</Chip>
)}
{userRole === "tutor" &&
(assignment.isPublished ? (
<Chip color="success" className="text-white font-bold mr-1">
Published
</Chip>
) : (
<Chip className="mr-1">Unpublished</Chip>
))}
{assignment.isPublished &&
(assignment.deadline < new Date().getTime() ? (
<Chip>Expired</Chip>
) : (
<Chip color="success" className="text-white font-bold">
Ongoing
</Chip>
))}
</CardHeader>
<CardBody className="pt-1">
<div className="flex justify-between items-start">
Expand Down

0 comments on commit a1a6374

Please sign in to comment.