Skip to content

Commit 4063690

Browse files
authored
Merge pull request #175 from ELIXIR-NO/aria-labels
add aria-labels
2 parents 1a07ad4 + 37f13db commit 4063690

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/components/navigation.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ export const Navigation = ({ pathname }) => {
7272
<button
7373
type="button"
7474
onClick={() => setMobileMenuOpen(true)}
75+
aria-label="Open main menu"
7576
className="-m-2.5 inline-flex items-center justify-center rounded-md p-2.5 text-gray-700"
7677
>
7778
<span className="sr-only">Open main menu</span>
@@ -89,7 +90,7 @@ export const Navigation = ({ pathname }) => {
8990
</div>
9091
<div className="hidden lg:flex gap-x-2 lg:flex-1 lg:justify-end">
9192
<ThemeToggle/>
92-
<button onClick={onSearchClick}>
93+
<button onClick={onSearchClick} aria-label="Search">
9394
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" strokeWidth={1.5}
9495
stroke="currentColor" className="size-6">
9596
<path strokeLinecap="round" strokeLinejoin="round"
@@ -98,7 +99,7 @@ export const Navigation = ({ pathname }) => {
9899
</button>
99100
</div>
100101
</nav>
101-
<Dialog open={mobileMenuOpen} onClose={setMobileMenuOpen} className="lg:hidden">
102+
<Dialog open={mobileMenuOpen} onClose={setMobileMenuOpen} className="lg:hidden" >
102103
<div className="fixed inset-0 z-50"/>
103104
<DialogPanel
104105
className="fixed inset-y-0 right-0 z-50 w-full overflow-y-auto bg-white px-6 py-6 sm:max-w-sm sm:ring-1 sm:ring-gray-900/10">
@@ -115,6 +116,7 @@ export const Navigation = ({ pathname }) => {
115116
type="button"
116117
onClick={() => setMobileMenuOpen(false)}
117118
className="flex items-center justify-center"
119+
aria-label="Close menu"
118120
>
119121
<span className="sr-only">Close menu</span>
120122
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"

src/components/theme-toggle.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default function ThemeToggle() {
88
};
99

1010
return (
11-
<button onClick={onClick} className="h-8 w-8 p-0.5 hover:scale-110">
11+
<button onClick={onClick} className="h-8 w-8 p-0.5 hover:scale-110" aria-label="Toggle Dark/Light Mode">
1212
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" strokeWidth={1.5}
1313
stroke="currentColor" className="size-6 block dark:hidden">
1414
<path strokeLinecap="round" strokeLinejoin="round"
@@ -22,4 +22,4 @@ export default function ThemeToggle() {
2222
</button>
2323
);
2424

25-
}
25+
}

0 commit comments

Comments
 (0)