From 0955f18e04eae65bc060a792b298f0db0daa81b1 Mon Sep 17 00:00:00 2001 From: Antonio De Lucreziis Date: Wed, 11 Jan 2023 17:52:29 +0100 Subject: [PATCH] fix: table style and empty scoreboard page --- client/pages/ScoresPage.tsx | 94 ++++++++++++++++++++----------------- client/styles/main.scss | 5 +- 2 files changed, 53 insertions(+), 46 deletions(-) diff --git a/client/pages/ScoresPage.tsx b/client/pages/ScoresPage.tsx index 56810cb..99bcc58 100644 --- a/client/pages/ScoresPage.tsx +++ b/client/pages/ScoresPage.tsx @@ -50,55 +50,61 @@ export const ScoresPage = () => {
Classifica
-
-
-
- Studente - setSortState(transitionMap[sortStateColumn][sortStateOrder]('student'))}> - - {sortStateColumn === 'student' - ? sortStateOrder === 'ascending' - ? 'expand_more' - : 'expand_less' - : 'unfold_more'} + {orderedStats.length > 0 ? ( +
+
+
+ Studente + setSortState(transitionMap[sortStateColumn][sortStateOrder]('student'))}> + + {sortStateColumn === 'student' + ? sortStateOrder === 'ascending' + ? 'expand_more' + : 'expand_less' + : 'unfold_more'} + - -
-
- Soluzioni Inviate - setSortState(transitionMap[sortStateColumn][sortStateOrder]('sent'))}> - - {sortStateColumn === 'sent' - ? sortStateOrder === 'ascending' - ? 'expand_more' - : 'expand_less' - : 'unfold_more'} +
+
+ Soluzioni Inviate + setSortState(transitionMap[sortStateColumn][sortStateOrder]('sent'))}> + + {sortStateColumn === 'sent' + ? sortStateOrder === 'ascending' + ? 'expand_more' + : 'expand_less' + : 'unfold_more'} + - -
-
- Soluzioni Corrette - setSortState(transitionMap[sortStateColumn][sortStateOrder]('correct'))}> - - {sortStateColumn === 'correct' - ? sortStateOrder === 'ascending' - ? 'expand_more' - : 'expand_less' - : 'unfold_more'} +
+
+ Soluzioni Corrette + setSortState(transitionMap[sortStateColumn][sortStateOrder]('correct'))}> + + {sortStateColumn === 'correct' + ? sortStateOrder === 'ascending' + ? 'expand_more' + : 'expand_less' + : 'unfold_more'} + - +
+ {orderedStats.map(([user, s]) => ( + <> +
+ @{user} +
+
{s.sentSolutionsCount}
+
{s.correctSolutionsCount}
+ + ))}
- {orderedStats.map(([user, s]) => ( - <> -
- @{user} -
-
{s.sentSolutionsCount}
-
{s.correctSolutionsCount}
- - ))}
-
+ ) : ( + <> +

Nessuno ha ancora inviato soluzioni

+ + )}
) diff --git a/client/styles/main.scss b/client/styles/main.scss index 92f934b..dbe2aac 100644 --- a/client/styles/main.scss +++ b/client/styles/main.scss @@ -290,7 +290,6 @@ $heading-scale: 1.25; flex-direction: column; width: 100%; } - } .text-body { @@ -479,9 +478,11 @@ main.page-scores { &:first-child { border-top-left-radius: 0.5rem; } + &:last-child { - border-top-left-radius: 0.5rem; + border-bottom-right-radius: 0.5rem; } + &.last-col { border-right: none; }