@@ -22,9 +22,10 @@ NavigationItem.propTypes = {
22
22
children : PropTypes . node . isRequired ,
23
23
url : PropTypes . string . isRequired ,
24
24
isactive : PropTypes . func ,
25
+ ariaLabel : PropTypes . string ,
25
26
} ;
26
27
27
- function NavigationItem ( { children, url, isactive } ) {
28
+ function NavigationItem ( { children, url, isactive, ariaLabel } ) {
28
29
let obj = { } ;
29
30
// decide if the link is active or not by providing a function
30
31
// otherwise we'll let react-dom makes the decision for us
@@ -42,6 +43,7 @@ function NavigationItem({ children, url, isactive }) {
42
43
target = "_blank"
43
44
rel = "noopener noreferrer"
44
45
className = { classes }
46
+ aria-label = { ariaLabel }
45
47
>
46
48
{ children }
47
49
</ a >
@@ -54,6 +56,7 @@ function NavigationItem({ children, url, isactive }) {
54
56
isActive ? `${ classes } !text-blue-200` : classes
55
57
}
56
58
to = { url }
59
+ aria-label = { ariaLabel }
57
60
>
58
61
{ children }
59
62
</ NavLink >
@@ -71,6 +74,7 @@ function NavigationIcon({ children, to, title }) {
71
74
to = { to }
72
75
className = "inline-flex items-center text-gray-100 dark:text-gray-200 hover:text-blue-200"
73
76
title = { `webpack on ${ title } ` }
77
+ aria-label = { `webpack on ${ title } ` }
74
78
>
75
79
{ children }
76
80
</ Link >
@@ -118,8 +122,13 @@ function Navigation({ links, pathname, hash = '', toggleSidebar }) {
118
122
< Logo />
119
123
</ Link >
120
124
< nav className = "hidden md:inline-grid md:grid-flow-col md:gap-x-[18px]" >
121
- { links . map ( ( { content, url, isActive } ) => (
122
- < NavigationItem key = { url } url = { url } isActive = { isActive } >
125
+ { links . map ( ( { content, url, isActive, ariaLabel } ) => (
126
+ < NavigationItem
127
+ key = { url }
128
+ url = { url }
129
+ isActive = { isActive }
130
+ ariaLabel = { ariaLabel }
131
+ >
123
132
{ content }
124
133
</ NavigationItem >
125
134
) ) }
0 commit comments