From 389caede59731960ecd08812fd8e796cb87486be Mon Sep 17 00:00:00 2001 From: Florian Dieminger Date: Wed, 31 Jan 2024 16:23:52 +0100 Subject: [PATCH] fix modules-list --- .../{landing.scss => modules-list.scss} | 0 client/src/curriculum/modules-list.tsx | 2 ++ client/src/curriculum/utils.ts | 26 +++++++++++++++++++ 3 files changed, 28 insertions(+) rename client/src/curriculum/{landing.scss => modules-list.scss} (100%) create mode 100644 client/src/curriculum/utils.ts diff --git a/client/src/curriculum/landing.scss b/client/src/curriculum/modules-list.scss similarity index 100% rename from client/src/curriculum/landing.scss rename to client/src/curriculum/modules-list.scss diff --git a/client/src/curriculum/modules-list.tsx b/client/src/curriculum/modules-list.tsx index 73ca4bef752c..d456fa520c2b 100644 --- a/client/src/curriculum/modules-list.tsx +++ b/client/src/curriculum/modules-list.tsx @@ -2,6 +2,8 @@ import { ModuleIndexEntry } from "../../../libs/types/curriculum"; import { TopicIcon } from "./topic-icon"; import { topic2css } from "./utils"; +import "./modules-list.scss"; + export function ModulesListList({ modules }: { modules: ModuleIndexEntry[] }) { return (
    diff --git a/client/src/curriculum/utils.ts b/client/src/curriculum/utils.ts new file mode 100644 index 000000000000..d73e1dd26bf3 --- /dev/null +++ b/client/src/curriculum/utils.ts @@ -0,0 +1,26 @@ +// Using this import fails the build... +//import { Topic } from "../../../libs/types/curriculum"; +export enum Topic { + WebStandards = "Web Standards & Semantics", + Styling = "Styling", + Scripting = "Scripting", + BestPractices = "Best Practices", + Tooling = "Tooling", + None = "", +} +export function topic2css(topic?: Topic) { + switch (topic) { + case Topic.WebStandards: + return "standards"; + case Topic.Styling: + return "styling"; + case Topic.Scripting: + return "scripting"; + case Topic.Tooling: + return "tooling"; + case Topic.BestPractices: + return "practices"; + default: + return "none"; + } +}