Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apply aria-label to NavBarButton #70

Merged
merged 2 commits into from
Feb 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/NavBarButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const NavBarButton = styled(
"aria-label": ariaLabel,
...props
}: NavBarButtonProps) => (
<Button className={className} {...props}>
<Button className={className} aria-label={ariaLabel} {...props}>
{icon &&
(typeof icon === "string" ? (
<img aria-hidden="true" src={icon} alt="" />
Expand Down
2 changes: 2 additions & 0 deletions src/components/__snapshots__/NavBarButton.spec.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

exports[`NavBarButton matches base64 icon snapshot 1`] = `
<button
aria-label="dots menu"
className="sc-bczRLJ dKgZvy"
data-rac=""
id="react-aria-5"
Expand Down Expand Up @@ -68,6 +69,7 @@ exports[`NavBarButton matches icon and text snapshot 1`] = `

exports[`NavBarButton matches svg icon snapshot 1`] = `
<button
aria-label="info"
className="sc-bczRLJ dKgZvy"
data-rac=""
id="react-aria-3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ exports[`NavBarMenuButton matches snapshot 1`] = `
exports[`NavBarPopoverButton matches custom aria label snapshot 1`] = `
<button
aria-expanded={false}
aria-label="Custom label"
className="sc-bczRLJ dKgZvy"
data-rac=""
id="react-aria-5"
Expand Down
Loading