aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/organisms/layout/footer.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2022-05-15 19:08:58 +0200
committerArmand Philippot <git@armandphilippot.com>2022-05-15 19:08:58 +0200
commit056ed0d5f050158cebad689099214b164539899a (patch)
tree8e28a82386a785568a7a655bf4d1213096b82589 /src/components/organisms/layout/footer.tsx
parentc95cce04393080a52a54191cff7be8fec68af4b0 (diff)
chore: improve accessibility
Diffstat (limited to 'src/components/organisms/layout/footer.tsx')
-rw-r--r--src/components/organisms/layout/footer.tsx15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/components/organisms/layout/footer.tsx b/src/components/organisms/layout/footer.tsx
index 15bfa24..1426e96 100644
--- a/src/components/organisms/layout/footer.tsx
+++ b/src/components/organisms/layout/footer.tsx
@@ -4,6 +4,7 @@ import Copyright, {
import BackToTop from '@components/molecules/buttons/back-to-top';
import Nav, { type NavItem } from '@components/molecules/nav/nav';
import { FC } from 'react';
+import { useIntl } from 'react-intl';
import styles from './footer.module.scss';
export type FooterProps = {
@@ -31,6 +32,13 @@ export type FooterProps = {
* Renders a footer with copyright and nav;
*/
const Footer: FC<FooterProps> = ({ className, copyright, navItems, topId }) => {
+ const intl = useIntl();
+ const ariaLabel = intl.formatMessage({
+ defaultMessage: 'Footer',
+ description: 'Footer: an accessible name for footer nav',
+ id: 'd4N8nD',
+ });
+
return (
<footer className={`${styles.wrapper} ${className}`}>
<Copyright
@@ -39,7 +47,12 @@ const Footer: FC<FooterProps> = ({ className, copyright, navItems, topId }) => {
icon={copyright.icon}
/>
{navItems && (
- <Nav kind="footer" items={navItems} className={styles.nav} />
+ <Nav
+ aria-label={ariaLabel}
+ kind="footer"
+ items={navItems}
+ className={styles.nav}
+ />
)}
<BackToTop target={topId} className={styles['back-to-top']} />
</footer>