From 6ba8a6cc5242ae47677cd062dba4771ab3d3595d Mon Sep 17 00:00:00 2001 From: Benjamin Arias Date: Mon, 13 Mar 2023 10:51:05 +0100 Subject: [PATCH] fix: Corrige aria-hidden --- site/source/design-system/icons/index.tsx | 3 - site/source/design-system/message/index.tsx | 2 +- .../source/pages/statistiques/GlobalStats.tsx | 100 ++++++++++-------- 3 files changed, 59 insertions(+), 46 deletions(-) diff --git a/site/source/design-system/icons/index.tsx b/site/source/design-system/icons/index.tsx index 22e832ec8..73562bf37 100644 --- a/site/source/design-system/icons/index.tsx +++ b/site/source/design-system/icons/index.tsx @@ -35,7 +35,6 @@ export const InfoIcon = (props: HTMLAttributes) => ( width={20} height={20} xmlns="http://www.w3.org/2000/svg" - aria-hidden role="img" > ) => ( width={20} height={20} xmlns="http://www.w3.org/2000/svg" - aria-hidden role="img" > ) => ( height="19" viewBox="0 0 20 19" xmlns="http://www.w3.org/2000/svg" - aria-hidden role="img" > ) : type === 'info' ? ( - + ) : ( )} diff --git a/site/source/pages/statistiques/GlobalStats.tsx b/site/source/pages/statistiques/GlobalStats.tsx index d72c5ffc2..b3952fed1 100644 --- a/site/source/pages/statistiques/GlobalStats.tsx +++ b/site/source/pages/statistiques/GlobalStats.tsx @@ -17,52 +17,68 @@ export const BigIndicator = ({ main, subTitle, footnote }: IndicatorProps) => ( ) - +const mappedLevelToLabel = { + mauvais: "Taux d'utilisateurs mécontents", + moyen: "Taux d'utilisateurs ayant un avis neutre", + bien: "Taux d'utilisateurs satisfaits", + 'très bien': "Taux d'utilisateurs très satisfaits", +} const RetoursAsProgress = ({ percentages, }: { percentages: Record -}) => ( -
- {' '} - {SatisfactionStyle.map(([level, { emoji: emojiStr, color }]) => ( -
- -
- {Math.round(percentages[level])}% -
-
- ))} -
-) +}) => { + const { t } = useTranslation() + + return ( +
    + {' '} + {SatisfactionStyle.map(([level, { emoji: emojiStr, color }]) => { + return ( +
  • + +
    + {Math.round(percentages[level])}% +
    +
  • + ) + })} +
+ ) +} export default function GlobalStats({ stats }: { stats: StatsStruct }) { const { i18n } = useTranslation()