From a1a6374ac580d57411f461c7f9a751688938389e Mon Sep 17 00:00:00 2001 From: vivienherq Date: Fri, 19 Apr 2024 04:11:25 +0800 Subject: [PATCH] Fix UI for chips display --- .../components/assignment/AssignmentList.tsx | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/frontend/src/components/assignment/AssignmentList.tsx b/frontend/src/components/assignment/AssignmentList.tsx index d62e5b7..54cc4d6 100644 --- a/frontend/src/components/assignment/AssignmentList.tsx +++ b/frontend/src/components/assignment/AssignmentList.tsx @@ -54,13 +54,22 @@ function AssignmentList({ assignments, userRole }: Props) { className="bg-white shadow-md" > - {assignment.isPublished ? ( - - Published - - ) : ( - Unpublished - )} + {userRole === "tutor" && + (assignment.isPublished ? ( + + Published + + ) : ( + Unpublished + ))} + {assignment.isPublished && + (assignment.deadline < new Date().getTime() ? ( + Expired + ) : ( + + Ongoing + + ))}