fix: ARIA fixes, missing button labels

This commit is contained in:
Tom Moor
2022-03-16 23:41:06 -07:00
parent adb7e99321
commit 203980c845
11 changed files with 54 additions and 25 deletions

View File

@@ -1,5 +1,6 @@
import { CollapsedIcon } from "outline-icons";
import * as React from "react";
import { useTranslation } from "react-i18next";
import styled, { css } from "styled-components";
import NudeButton from "~/components/NudeButton";
@@ -10,8 +11,16 @@ type Props = {
};
function Disclosure({ onClick, root, expanded, ...rest }: Props) {
const { t } = useTranslation();
return (
<Button size={20} onClick={onClick} $root={root} {...rest}>
<Button
size={20}
onClick={onClick}
$root={root}
aria-label={expanded ? t("Collapse") : t("Expand")}
{...rest}
>
<StyledCollapsedIcon expanded={expanded} size={20} color="currentColor" />
</Button>
);