Improve accessibility

This commit is contained in:
Kevin Kandlbinder 2021-12-06 15:49:38 +00:00 committed by GitHub
parent e56ca5010c
commit b0e1d04030
4 changed files with 11 additions and 1 deletions

View file

@ -59,6 +59,8 @@
"donatePayPal": "Über PayPal spenden" "donatePayPal": "Über PayPal spenden"
}, },
"menu": "Menü", "menu": "Menü",
"closeMenu": "Menü schließen",
"openMenu": "Menü öffnen",
"language": { "language": {
"en": { "en": {
"name": "Englisch" "name": "Englisch"

View file

@ -59,6 +59,8 @@
"donatePayPal": "Donate using PayPal" "donatePayPal": "Donate using PayPal"
}, },
"menu": "Menu", "menu": "Menu",
"closeMenu": "Close Menu",
"openMenu": "Open Menu",
"language": { "language": {
"en": { "en": {
"name": "English" "name": "English"

View file

@ -101,6 +101,7 @@ const Navigation = ({ isHome }) => {
toggled={offscreenNavActive} toggled={offscreenNavActive}
rounded rounded
size={30} size={30}
label={t("openMenu")}
/> />
</div> </div>
</nav> </nav>

View file

@ -8,6 +8,7 @@ import * as styles from "./navigation.module.scss";
import { X } from "lucide-react"; import { X } from "lucide-react";
const OffScreenNav = ({ active, close }) => { const OffScreenNav = ({ active, close }) => {
const { t } = useTranslation();
if (typeof document === "undefined") return <></>; if (typeof document === "undefined") return <></>;
return createPortal( return createPortal(
@ -17,7 +18,11 @@ const OffScreenNav = ({ active, close }) => {
} }
> >
<div className={styles.inner}> <div className={styles.inner}>
<button className={styles.close} onClick={close}> <button
className={styles.close}
onClick={close}
aria-label={t("closeMenu")}
>
<X /> <X />
</button> </button>
<span> <span>