Skip to content

Commit

Permalink
apply aria-label to NavBarButton (#70)
Browse files Browse the repository at this point in the history
add missing prop

Co-authored-by: Beth Shook <es66@rice.edu>
  • Loading branch information
bethshook and Beth Shook authored Feb 18, 2025
1 parent d8c3784 commit 30babb1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
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

0 comments on commit 30babb1

Please sign in to comment.