Skip to content

Commit f5e75ce

Browse files
committed
feat: add accessibility attributes to ChainLink and Button components in Footer, Navbar, and AddressChip
1 parent f704e37 commit f5e75ce

File tree

4 files changed

+22
-7
lines changed

4 files changed

+22
-7
lines changed

src/components/Footer.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,12 @@ export function Footer({ className }: { className?: string }) {
7878
)}
7979
>
8080
<div className="flex flex-col items-center justify-between gap-10 xl:flex-row">
81-
<ChainLink to="/" className="flex items-center gap-2 font-mono">
82-
<img src={iExecLogo} width="25" height="25" alt="iExec logo" />
81+
<ChainLink
82+
to="/"
83+
aria-label="Home"
84+
className="flex items-center gap-2 font-mono"
85+
>
86+
<img src={iExecLogo} width="25" height="25" alt="" />
8387
<span>iExec Explorer</span>
8488
</ChainLink>
8589

src/components/ModeToggle.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export function ModeToggle() {
3434
size="none"
3535
role="radio"
3636
aria-checked={selected}
37-
aria-label={label}
37+
aria-label={`Toggle ${label} mode`}
3838
title={label}
3939
className={cn(
4040
'text-foreground hover:bg-muted p-1',

src/components/navbar/AddressChip.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export function AddressChip({ address }: { address: string }) {
4242
<Button
4343
className="dark:bg-popover bg-primary-foreground hover:bg-muted text-primary dark:text-brand duration-300"
4444
variant="secondary"
45+
aria-label="Copy connected wallet address"
4546
onClick={handleCopy}
4647
onMouseEnter={handleMouseEnter}
4748
onMouseLeave={handleMouseLeave}

src/components/navbar/NavBar.tsx

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,12 @@ export function Navbar() {
1919

2020
return (
2121
<nav className="flex items-center justify-between py-6">
22-
<ChainLink to="/" className="-m-2 flex items-center gap-2 p-2 font-mono">
23-
<img src={iExecLogo} width="25" height="25" alt="iExec logo" />
22+
<ChainLink
23+
to="/"
24+
aria-label="Home"
25+
className="-m-2 flex items-center gap-2 p-2 font-mono"
26+
>
27+
<img src={iExecLogo} width="25" height="25" alt="" />
2428
<span className="hidden lg:block">iExec Explorer</span>
2529
</ChainLink>
2630
<div className="mr-8 flex items-center gap-4 md:mr-0">
@@ -76,6 +80,7 @@ export function Navbar() {
7680
className="absolute -inset-2 size-10 cursor-pointer appearance-none bg-transparent"
7781
name="menu"
7882
id="menu"
83+
aria-label="Toggle navigation menu"
7984
checked={isMenuOpen}
8085
readOnly
8186
/>
@@ -86,8 +91,13 @@ export function Navbar() {
8691

8792
<div className="border-secondary bg-background pointer-events-auto fixed inset-y-0 left-0 z-10 flex w-full -translate-x-full flex-col overflow-auto rounded-r-3xl border-r px-6 pt-6 duration-200 group-has-[:checked]:translate-x-0 lg:w-[255px] lg:translate-x-0">
8893
<div className="-m-2 mr-6 flex items-center justify-between gap-2 py-2 pl-2">
89-
<ChainLink to="/" className="font-mono" onClick={handleMenuToggle}>
90-
<img src={iExecLogo} width="25" height="25" alt="iExec logo" />
94+
<ChainLink
95+
to="/"
96+
aria-label="Home"
97+
className="font-mono"
98+
onClick={handleMenuToggle}
99+
>
100+
<img src={iExecLogo} width="25" height="25" alt="" />
91101
</ChainLink>
92102
{isConnected ? (
93103
<div className="flex max-w-[1260px] items-center gap-2">

0 commit comments

Comments
 (0)