@@ -22,9 +22,10 @@ NavigationItem.propTypes = {
2222 children : PropTypes . node . isRequired ,
2323 url : PropTypes . string . isRequired ,
2424 isactive : PropTypes . func ,
25+ ariaLabel : PropTypes . string ,
2526} ;
2627
27- function NavigationItem ( { children, url, isactive } ) {
28+ function NavigationItem ( { children, url, isactive, ariaLabel } ) {
2829 let obj = { } ;
2930 // decide if the link is active or not by providing a function
3031 // otherwise we'll let react-dom makes the decision for us
@@ -42,6 +43,7 @@ function NavigationItem({ children, url, isactive }) {
4243 target = "_blank"
4344 rel = "noopener noreferrer"
4445 className = { classes }
46+ aria-label = { ariaLabel }
4547 >
4648 { children }
4749 </ a >
@@ -54,6 +56,7 @@ function NavigationItem({ children, url, isactive }) {
5456 isActive ? `${ classes } !text-blue-200` : classes
5557 }
5658 to = { url }
59+ aria-label = { ariaLabel }
5760 >
5861 { children }
5962 </ NavLink >
@@ -71,6 +74,7 @@ function NavigationIcon({ children, to, title }) {
7174 to = { to }
7275 className = "inline-flex items-center text-gray-100 dark:text-gray-200 hover:text-blue-200"
7376 title = { `webpack on ${ title } ` }
77+ aria-label = { `webpack on ${ title } ` }
7478 >
7579 { children }
7680 </ Link >
@@ -118,8 +122,13 @@ function Navigation({ links, pathname, hash = '', toggleSidebar }) {
118122 < Logo />
119123 </ Link >
120124 < 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+ >
123132 { content }
124133 </ NavigationItem >
125134 ) ) }
0 commit comments