From be61ffb6fe500cdbfa83b9cd131b8e72779f23c2 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Wed, 4 Oct 2023 18:17:35 +0200 Subject: refactor(components): rewrite BackToTop component * replace `link` prop with `anchor` prop * add a `label` prop to let consumer handle the accessible name --- src/components/organisms/layout/site-footer.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/components/organisms/layout') diff --git a/src/components/organisms/layout/site-footer.tsx b/src/components/organisms/layout/site-footer.tsx index d767a4d..0866924 100644 --- a/src/components/organisms/layout/site-footer.tsx +++ b/src/components/organisms/layout/site-footer.tsx @@ -50,6 +50,12 @@ export const SiteFooter: FC = ({ description: 'SiteFooter: an accessible name for the footer nav', id: 'pRzkFR', }); + const backToTop = intl.formatMessage({ + defaultMessage: 'Back to top', + description: 'SiteFooter: an accessible name for the back to top button', + id: 'OHvb01', + }); + const backToTopAnchor = `#${topId}`; const footerClass = `${styles.wrapper} ${className}`; const btnClass = `${styles['back-to-top']} ${backToTopClassName}`; @@ -69,7 +75,11 @@ export const SiteFooter: FC = ({ kind="footer" /> ) : null} - + ); }; -- cgit v1.2.3