From 31d9011ae1faff4d14749ba05487b237e07e6808 Mon Sep 17 00:00:00 2001 From: Grise <148749571+Grise3@users.noreply.github.com> Date: Tue, 27 Jan 2026 21:58:54 +0000 Subject: [PATCH 1/4] feat(grades): Display if it is a bonus grade and if it is an optional grade --- app/(modals)/grade.tsx | 20 +++++++++++++++++++- locales/en.json | 2 ++ locales/fr.json | 3 +++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/app/(modals)/grade.tsx b/app/(modals)/grade.tsx index ae5e169f3..497558b73 100644 --- a/app/(modals)/grade.tsx +++ b/app/(modals)/grade.tsx @@ -39,6 +39,8 @@ export default function GradesModal() { } const { grade, subjectInfo, avgInfluence = 0, avgClass = 0 } = params as GradesModalProps; + console.log(JSON.stringify(grade, null, 2)); + return ( <> } + {grade.optional && + + + + {t("Modal_Grades_OptionalGrade")} + + + } + {grade.bonus && + + + + {t("Modal_Grades_BonusGrade")} + + + } ) -} \ No newline at end of file +} diff --git a/locales/en.json b/locales/en.json index 74de33ccf..f1b618a76 100644 --- a/locales/en.json +++ b/locales/en.json @@ -230,6 +230,8 @@ "Profile_Cards_Title": "QR-code and cards", "Modal_Grades_Title": "Grade details", "Modal_Grades_BestGrade": "Best grade of your group", + "Modal_Grades_OptionalGrade": "Optional grade", + "Modal_Grades_BonusGrade": "Bonus grade", "Grades_Details_Title": "Details", "Grades_NormalizedGrade_Title": "Grade normalized to 20", "Grades_NormalizedGrade_Description": "Grade value converted to a scale of 20", diff --git a/locales/fr.json b/locales/fr.json index ec510df03..24be994e0 100644 --- a/locales/fr.json +++ b/locales/fr.json @@ -276,6 +276,9 @@ "Modal_Grades_Title": "Détail de la note", "Modal_Grades_BestGrade": "Meilleure note du groupe", + "Modal_Grades_OptionalGrade": "Note optionnelle", + "Modal_Grades_BonusGrade": "Note bonus", + "Grades_Details_Title": "Détails", "Grades_NormalizedGrade_Title": "Note ramenée sur 20", "Grades_NormalizedGrade_Description": "Valeur de la note convertie sur une échelle de 20", From 23afce362fe743730c53568f0f50e9fa1023481f Mon Sep 17 00:00:00 2001 From: Grise <148749571+Grise3@users.noreply.github.com> Date: Tue, 27 Jan 2026 22:04:35 +0000 Subject: [PATCH 2/4] fix(grade): removed old console.log --- app/(modals)/grade.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/(modals)/grade.tsx b/app/(modals)/grade.tsx index 497558b73..6505c457a 100644 --- a/app/(modals)/grade.tsx +++ b/app/(modals)/grade.tsx @@ -39,8 +39,6 @@ export default function GradesModal() { } const { grade, subjectInfo, avgInfluence = 0, avgClass = 0 } = params as GradesModalProps; - console.log(JSON.stringify(grade, null, 2)); - return ( <> Date: Tue, 27 Jan 2026 22:24:59 +0000 Subject: [PATCH 3/4] refactor(grade): create reusable GradeBadge component to avoid code duplication --- app/(modals)/grade.tsx | 57 +++++++++++++++++++++++++++++------------- 1 file changed, 39 insertions(+), 18 deletions(-) diff --git a/app/(modals)/grade.tsx b/app/(modals)/grade.tsx index 6505c457a..09eadb668 100644 --- a/app/(modals)/grade.tsx +++ b/app/(modals)/grade.tsx @@ -29,6 +29,27 @@ interface GradesModalProps { avgClass: number; } +interface GradeBadgeProps { + icon: string; + label: string; + color: string; + theme: any; +} + +const GradeBadge = ({ icon, label, color, theme }: GradeBadgeProps) => { + const backgroundColor = adjust(color, theme.dark ? 0.3 : -0.3); + const textColor = colorCheck("#FFFFFF", [backgroundColor]) ? "#FFFFFF" : "#000000"; + + return ( + + + + {label} + + + ); +}; + export default function GradesModal() { const { params } = useRoute(); const theme = useTheme(); @@ -159,29 +180,29 @@ export default function GradesModal() { /> {grade.studentScore?.value === grade.maxScore?.value && !grade.studentScore?.disabled && - - - - {t("Modal_Grades_BestGrade")} - - + } {grade.optional && - - - - {t("Modal_Grades_OptionalGrade")} - - + } {grade.bonus && - - - - {t("Modal_Grades_BonusGrade")} - - + } Date: Sun, 8 Feb 2026 11:57:57 +0000 Subject: [PATCH 4/4] feat(grade): optinal & bunus grande are now outlined and use the info icon --- app/(modals)/grade.tsx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/app/(modals)/grade.tsx b/app/(modals)/grade.tsx index 09eadb668..ff0ae461a 100644 --- a/app/(modals)/grade.tsx +++ b/app/(modals)/grade.tsx @@ -34,14 +34,16 @@ interface GradeBadgeProps { label: string; color: string; theme: any; + is_outlined?: boolean; } -const GradeBadge = ({ icon, label, color, theme }: GradeBadgeProps) => { - const backgroundColor = adjust(color, theme.dark ? 0.3 : -0.3); - const textColor = colorCheck("#FFFFFF", [backgroundColor]) ? "#FFFFFF" : "#000000"; +const GradeBadge = ({ icon, label, color, theme, is_outlined = false }: GradeBadgeProps) => { + const backgroundColor = is_outlined ? "transparent" : adjust(color, theme.dark ? 0.3 : -0.3); + const textColor = is_outlined ? color : (colorCheck("#FFFFFF", [backgroundColor]) ? "#FFFFFF" : "#000000"); + const borderStyle = is_outlined ? { borderWidth: 1, borderColor: color } : undefined; return ( - + {label} @@ -185,23 +187,26 @@ export default function GradesModal() { label={t("Modal_Grades_BestGrade")} color={subjectInfo.color} theme={theme} + is_outlined={false} /> } {grade.optional && } {grade.bonus && }