From 35b3c34728564dfb0d48333239cc7d2d50d32302 Mon Sep 17 00:00:00 2001 From: Bulgus Date: Wed, 13 Nov 2024 08:10:36 +0100 Subject: [PATCH] No class average if it is not known --- .../account/Grades/Graph/GradesAverage.tsx | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/views/account/Grades/Graph/GradesAverage.tsx b/src/views/account/Grades/Graph/GradesAverage.tsx index 80be5ac8c..ddf60fd94 100644 --- a/src/views/account/Grades/Graph/GradesAverage.tsx +++ b/src/views/account/Grades/Graph/GradesAverage.tsx @@ -122,7 +122,10 @@ const GradesAverageGraph: React.FC = ({ }} activeScale={0.975} weight="light" - onPress={() => setShowDetails(!showDetails)} + onPress={() => { + if (classAvg !== 0) { + setShowDetails(!showDetails); + }}} > {hLength > 0 && ( @@ -230,13 +233,19 @@ const GradesAverageGraph: React.FC = ({ style={[styles.gradeValue]} layout={animPapillon(LinearTransition)} > - - - /20 - + {classAvg === 0 ? ( + Inconnue + ) : ( + <> + + + /20 + + + )}