Changed the criteria for the filter on student assignment
This commit is contained in:
@@ -27,6 +27,7 @@ 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";
|
||||
|
||||
interface Props {
|
||||
user: User;
|
||||
@@ -69,6 +70,9 @@ export default function StudentDashboard({user, users, linkedCorporate}: Props)
|
||||
});
|
||||
};
|
||||
|
||||
const studentAssignments = assignments
|
||||
.filter(activeAssignmentFilter);
|
||||
|
||||
return (
|
||||
<>
|
||||
{linkedCorporate && (
|
||||
@@ -119,10 +123,9 @@ export default function StudentDashboard({user, users, linkedCorporate}: Props)
|
||||
</div>
|
||||
</div>
|
||||
<span className="text-mti-gray-taupe scrollbar-hide flex gap-8 overflow-x-scroll">
|
||||
{assignments.filter((a) => moment(a.endDate).isSameOrAfter(moment())).length === 0 &&
|
||||
{studentAssignments.length === 0 &&
|
||||
"Assignments will appear here. It seems that for now there are no assignments for you."}
|
||||
{assignments
|
||||
.filter((a) => moment(a.endDate).isSameOrAfter(moment()))
|
||||
{studentAssignments
|
||||
.sort((a, b) => moment(a.startDate).diff(b.startDate))
|
||||
.map((assignment) => (
|
||||
<div
|
||||
|
||||
Reference in New Issue
Block a user