fix(a11y): use appropriate aria-label for fCC logo depending on its use (#45201)
This commit is contained in:
@ -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<SVGSVGElement>
|
||||
): JSX.Element {
|
||||
return (
|
||||
<svg
|
||||
aria-label={t('aria.fcc-curriculum')}
|
||||
height={24}
|
||||
version='1.1'
|
||||
viewBox='0 0 210 24'
|
||||
width={210}
|
||||
xmlns='http://www.w3.org/2000/svg'
|
||||
xmlnsXlink='http://www.w3.org/1999/xlink'
|
||||
{...props}
|
||||
>
|
||||
<defs>
|
||||
<path
|
||||
|
@ -322,7 +322,7 @@ const ShowCertification = (props: ShowCertificationProps): JSX.Element => {
|
||||
<header>
|
||||
<Col md={5} sm={12}>
|
||||
<div className='logo'>
|
||||
<FreeCodeCampLogo />
|
||||
<FreeCodeCampLogo aria-hidden='true' />
|
||||
</div>
|
||||
</Col>
|
||||
<Col md={7} sm={12}>
|
||||
|
@ -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 <FreeCodeCampLogo />;
|
||||
const { t } = useTranslation();
|
||||
return <FreeCodeCampLogo aria-label={t('aria.fcc-curriculum')} />;
|
||||
};
|
||||
|
||||
NavLogo.displayName = 'NavLogo';
|
||||
|
Reference in New Issue
Block a user