From 104f994b391d97e9d988e86b31c59e667c413905 Mon Sep 17 00:00:00 2001 From: Isahann Hanacleto Date: Mon, 14 Aug 2023 13:42:27 -0300 Subject: [PATCH] #23 adding all scores --- .../score-window/score-window.component.html | 27 ++++++++++++++++--- .../score-window/score-window.component.sass | 14 ++++++++++ .../score-window/score-window.component.ts | 5 ++++ 3 files changed, 42 insertions(+), 4 deletions(-) diff --git a/src/app/score-window/score-window.component.html b/src/app/score-window/score-window.component.html index c89da8d..621704e 100644 --- a/src/app/score-window/score-window.component.html +++ b/src/app/score-window/score-window.component.html @@ -5,9 +5,9 @@
- - - + + +
@@ -17,8 +17,27 @@
+
+ + +
+
- +
diff --git a/src/app/score-window/score-window.component.sass b/src/app/score-window/score-window.component.sass index 732dcad..50540f8 100644 --- a/src/app/score-window/score-window.component.sass +++ b/src/app/score-window/score-window.component.sass @@ -45,3 +45,17 @@ color: green font-weight: bold margin: 5px + + &_previous-scores + width: 100% + display: flex + flex-direction: column + align-items: center + justify-content: center + + .tree-view + margin: 5px + width: 200px + max-height: 200px + overflow: auto + diff --git a/src/app/score-window/score-window.component.ts b/src/app/score-window/score-window.component.ts index 01b1764..b3500a5 100644 --- a/src/app/score-window/score-window.component.ts +++ b/src/app/score-window/score-window.component.ts @@ -17,6 +17,7 @@ export class ScoreWindowComponent implements OnInit { public currentWeek: number = 0; public rightAnswers: number = 0; public wrongAnswers: number = 0; + public previousScores: Map | null = null; public clipboardText: string = ''; public displayClipboardMessage: boolean = false; @@ -58,7 +59,11 @@ export class ScoreWindowComponent implements OnInit { private retrieveScore(): void { const currentWeek: number = moment().isoWeek(); const currentWeekScore: WeekScore = this.appStorageService.retrieveScoreByWeek(currentWeek); + const previousScoresMap: Map = this.appStorageService.retrieveAppStorage().weekScoreMap!; + // previousScoresMap.delete(currentWeek); + + this.previousScores = previousScoresMap; this.currentScore = currentWeekScore.score; this.rightAnswers = currentWeekScore.rightAnswers; this.wrongAnswers = currentWeekScore.wrongAnswers;