From c681c3358784f5a9644404c8da0e15b1117cd3fb Mon Sep 17 00:00:00 2001 From: sidemt Date: Wed, 23 Feb 2022 17:22:44 +0900 Subject: [PATCH] fix(a11y): use appropriate aria-label for fCC logo depending on its use (#45201) --- client/src/assets/icons/FreeCodeCamp-logo.tsx | 9 ++++----- client/src/client-only-routes/show-certification.tsx | 2 +- client/src/components/Header/components/nav-logo.tsx | 4 +++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/client/src/assets/icons/FreeCodeCamp-logo.tsx b/client/src/assets/icons/FreeCodeCamp-logo.tsx index ff223b69ef..1e1a28f832 100644 --- a/client/src/assets/icons/FreeCodeCamp-logo.tsx +++ b/client/src/assets/icons/FreeCodeCamp-logo.tsx @@ -1,18 +1,17 @@ import React from 'react'; -import { useTranslation } from 'react-i18next'; - -function FreeCodeCampLogo(): JSX.Element { - const { t } = useTranslation(); +function FreeCodeCampLogo( + props: JSX.IntrinsicAttributes & React.SVGProps +): JSX.Element { return ( {
- +
diff --git a/client/src/components/Header/components/nav-logo.tsx b/client/src/components/Header/components/nav-logo.tsx index ace653c28c..94111b149c 100644 --- a/client/src/components/Header/components/nav-logo.tsx +++ b/client/src/components/Header/components/nav-logo.tsx @@ -1,8 +1,10 @@ import React from 'react'; +import { useTranslation } from 'react-i18next'; import FreeCodeCampLogo from '../../../assets/icons/FreeCodeCamp-logo'; const NavLogo = (): JSX.Element => { - return ; + const { t } = useTranslation(); + return ; }; NavLogo.displayName = 'NavLogo';