Skip to content
This repository has been archived by the owner on Aug 25, 2024. It is now read-only.

Commit

Permalink
Ajouter une condition pour afficher "N/A" si la valeur de la note est…
Browse files Browse the repository at this point in the history
… absente
  • Loading branch information
ecnivtwelve committed Feb 10, 2024
1 parent 9c48873 commit f427457
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions views/GradesScreenNew.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -654,9 +654,15 @@ const LatestGradesList = React.memo(({ isLoading, grades, allGrades, gradeSettin
</NativeText>

<View style={subjectStyles.smallGradeContainer}>
<NativeText style={subjectStyles.smallGradeValue}>
{((grade.grade.value?.value / grade.grade.out_of.value) * gradeSettings.scale).toFixed(2)}
</NativeText>
{ grade.grade.value?.value ? (
<NativeText style={subjectStyles.smallGradeValue}>
{((grade.grade.value?.value / grade.grade.out_of.value) * gradeSettings.scale).toFixed(2)}
</NativeText>
) : (
<NativeText style={subjectStyles.smallGradeValue}>
N/A
</NativeText>
)}
<NativeText style={subjectStyles.smallGradeScale}>
/{gradeSettings.scale.toFixed(0)}
</NativeText>
Expand Down

0 comments on commit f427457

Please sign in to comment.