@@ -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 >
@@ -119,8 +122,13 @@ function Navigation({ links, pathname, hash = '', toggleSidebar }) {
119122 < Logo />
120123 </ Link >
121124 < nav className = "hidden md:inline-grid md:grid-flow-col md:gap-x-[18px]" >
122- { links . map ( ( { content, url, isActive } ) => (
123- < 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+ >
124132 { content }
125133 </ NavigationItem >
126134 ) ) }
0 commit comments