diff --git a/src/components/ModuleBadge.tsx b/src/components/ModuleBadge.tsx
index 0a791bd6..a3dc62ee 100644
--- a/src/components/ModuleBadge.tsx
+++ b/src/components/ModuleBadge.tsx
@@ -3,15 +3,21 @@ import {getGradingLabel, getLevelLabel} from "@/utils/score";
import clsx from "clsx";
import {BsBook, BsClipboard, BsHeadphones, BsMegaphone, BsPen} from "react-icons/bs";
-const ModuleBadge: React.FC<{module: string; level?: number; gradingSystem?: Step[]}> = ({module, level, gradingSystem}) => (
+const ModuleBadge: React.FC<{module: string; level?: number; gradingSystem?: Step[]; className?: string}> = ({
+ module,
+ level,
+ gradingSystem,
+ className,
+}) => (
{module === "reading" && }
{module === "listening" && }
diff --git a/src/dashboards/Student.tsx b/src/dashboards/Student.tsx
index 354121dc..3789748c 100644
--- a/src/dashboards/Student.tsx
+++ b/src/dashboards/Student.tsx
@@ -27,7 +27,8 @@ import {useRouter} from "next/router";
import {useEffect, useState} from "react";
import {BsArrowRepeat, BsBook, BsClipboard, BsFileEarmarkText, BsHeadphones, BsMegaphone, BsPen, BsPencil, BsStar} from "react-icons/bs";
import {toast} from "react-toastify";
-import { activeAssignmentFilter } from "@/utils/assignments";
+import {activeAssignmentFilter} from "@/utils/assignments";
+import ModuleBadge from "@/components/ModuleBadge";
interface Props {
user: User;
@@ -70,8 +71,7 @@ export default function StudentDashboard({user, users, linkedCorporate}: Props)
});
};
- const studentAssignments = assignments
- .filter(activeAssignmentFilter);
+ const studentAssignments = assignments.filter(activeAssignmentFilter);
return (
<>
@@ -123,49 +123,32 @@ export default function StudentDashboard({user, users, linkedCorporate}: Props)
- {studentAssignments.length === 0 &&
- "Assignments will appear here. It seems that for now there are no assignments for you."}
+ {studentAssignments.length === 0 && "Assignments will appear here. It seems that for now there are no assignments for you."}
{studentAssignments
.sort((a, b) => moment(a.startDate).diff(b.startDate))
.map((assignment) => (
r.user).includes(user.id) && "border-mti-green-light",
)}
key={assignment.id}>
{assignment.name}
-
+
{moment(assignment.startDate).format("DD/MM/YY, HH:mm")}
-
{moment(assignment.endDate).format("DD/MM/YY, HH:mm")}
-
+
{assignment.exams
.filter((e) => e.assignee === user.id)
.map((e) => e.module)
.sort(sortByModuleName)
.map((module) => (
-
- {module === "reading" && }
- {module === "listening" && }
- {module === "writing" && }
- {module === "speaking" && }
- {module === "level" && }
-
+
))}
{!assignment.results.map((r) => r.user).includes(user.id) && (
@@ -173,12 +156,11 @@ export default function StudentDashboard({user, users, linkedCorporate}: Props)
-
+
Start
startAssignment(assignment)}
variant="outline">