From 4910eb00d081472d3e98e1e53f0ed330994963f1 Mon Sep 17 00:00:00 2001 From: Christian Cueni Date: Mon, 8 Jan 2024 14:08:23 +0100 Subject: [PATCH] Add reflection icon --- client/src/utils/typeMaps.ts | 8 ++++++-- client/src/utils/utils.ts | 9 +++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/client/src/utils/typeMaps.ts b/client/src/utils/typeMaps.ts index 618353fe..d804916a 100644 --- a/client/src/utils/typeMaps.ts +++ b/client/src/utils/typeMaps.ts @@ -1,5 +1,9 @@ import type { LearningContent } from "@/types"; -import { assertUnreachable, getAssignmentTypeTitle } from "@/utils/utils"; +import { + assertUnreachable, + getAssignmentTypeIcon, + getAssignmentTypeTitle, +} from "@/utils/utils"; import { useTranslation } from "i18next-vue"; export interface LearningContentIdentifier { @@ -15,7 +19,7 @@ export function learningContentTypeData( case "learnpath.LearningContentAssignment": { return { title: getAssignmentTypeTitle(lc.assignment_type), - icon: "it-icon-lc-assignment", + icon: getAssignmentTypeIcon(lc.assignment_type), }; } case "learnpath.LearningContentAttendanceCourse": diff --git a/client/src/utils/utils.ts b/client/src/utils/utils.ts index 75164a9d..272cac03 100644 --- a/client/src/utils/utils.ts +++ b/client/src/utils/utils.ts @@ -60,3 +60,12 @@ export function getAssignmentTypeTitle(assignmentType: AssignmentType): string { return "unknown"; } } + +export function getAssignmentTypeIcon(assignmentType: AssignmentType): string { + switch (assignmentType) { + case "REFLECTION": + return "it-icon-lc-reflection"; + default: + return "it-icon-lc-assignment"; + } +}