From ae32e264b668a46e138a64a2d8a8d4c662e990ea Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Wed, 19 Mar 2025 15:57:50 +0000 Subject: fix/frontend: broken summary difficulty v2 (#272) --- frontend/src/components/Summary.tsx | 17 ++++++++++++++++- frontend/src/types/Map.ts | 1 + 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'frontend') diff --git a/frontend/src/components/Summary.tsx b/frontend/src/components/Summary.tsx index 1df6a78..7da2f1e 100644 --- a/frontend/src/components/Summary.tsx +++ b/frontend/src/components/Summary.tsx @@ -139,6 +139,21 @@ const Summary: React.FC = ({ selectedRun, setSelectedRun, data })
+ Difficulty + {data.map.difficulty <= 2 && (Very easy)} + {data.map.difficulty > 2 && data.map.difficulty <= 4 && (Easy)} + {data.map.difficulty > 4 && data.map.difficulty <= 6 && (Medium)} + {data.map.difficulty > 6 && data.map.difficulty <= 8 && (Hard)} + {data.map.difficulty > 8 && data.map.difficulty <= 10 && (Very hard)} +
+ {data.map.difficulty <= 2 ? (
) : (
)} + {data.map.difficulty > 2 && data.map.difficulty <= 4 ? (
) : (
)} + {data.map.difficulty > 4 && data.map.difficulty <= 6 ? (
) : (
)} + {data.map.difficulty > 6 && data.map.difficulty <= 8 ? (
) : (
)} + {data.map.difficulty > 8 && data.map.difficulty <= 10 ? (
) : (
)} +
+
+ {/*
Difficulty {data.summary.routes[selectedRun].rating <= 2 && (Very easy)} {data.summary.routes[selectedRun].rating > 2 && data.summary.routes[selectedRun].rating <= 4 && (Easy)} @@ -152,7 +167,7 @@ const Summary: React.FC = ({ selectedRun, setSelectedRun, data }) {data.summary.routes[selectedRun].rating > 6 && data.summary.routes[selectedRun].rating <= 8 ? (
) : (
)} {data.summary.routes[selectedRun].rating > 8 && data.summary.routes[selectedRun].rating <= 10 ? (
) : (
)}
- + */}
Completion Count
{data.summary.routes[selectedRun].completion_count}
diff --git a/frontend/src/types/Map.ts b/frontend/src/types/Map.ts index 89c66d5..4f8eabf 100644 --- a/frontend/src/types/Map.ts +++ b/frontend/src/types/Map.ts @@ -79,6 +79,7 @@ interface MapSummaryMap { map_name: string; is_coop: boolean; is_disabled: boolean; + difficulty: number; }; interface MapSummaryDetails { -- cgit v1.2.3