From 1c1c9a1346081dea928967904b0d8f4d65e277ff Mon Sep 17 00:00:00 2001 From: Gregory Travis Date: Sun, 15 Oct 2023 18:56:40 -0400 Subject: [PATCH] Added difficulty labels to lesson cards --- app/Components/Home/LessonPanel.tsx | 31 +++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/app/Components/Home/LessonPanel.tsx b/app/Components/Home/LessonPanel.tsx index 08052765..3c11f264 100644 --- a/app/Components/Home/LessonPanel.tsx +++ b/app/Components/Home/LessonPanel.tsx @@ -20,6 +20,8 @@ import { CARD_PADDING, CARD_WIDTH, calculateCardsPerRow, + difficulty, + getDifficultyColor, } from "./Cards"; let lessonImages: ImageURISource[] = [ @@ -102,6 +104,28 @@ const LessonPanel = (props: any) => { } else { img = lessonImages[i]; } + let difficulty: difficulty; + switch (availableLessons[i]) { + case "SUDOKU_101": + case "AMEND_NOTES": + case "NAKED_SINGLE": + case "SIMPLIFY_NOTES": + difficulty = "Very Easy"; + break; + case "NAKED_SET": + difficulty = "Easy"; + break; + case "HIDDEN_SINGLE": + difficulty = "Intermediate"; + break; + case "HIDDEN_SET": + difficulty = "Hard"; + break; + default: + difficulty = "Very Hard"; + break; + } + let difficultyColor: string = getDifficultyColor(difficulty); subArray.push( { {formatOneLessonName(availableLessons[i])} + + {difficulty} +