@@ -19,10 +19,12 @@ class Header extends BaseComponent {
1919
2020 renderMenuItemChildren ( parentText , children ) {
2121 const linkChildren = children . map ( ( link ) => {
22+ const badge = link . badgeCount > 0 ? < span className = { `badge ${ link . badgeClass } ` } > { link . badgeCount } </ span > : null
23+
2224 return (
2325 < li key = { link . text } className = 'dropdown-item nav-link' >
2426 < Link key = { link . text } to = { link . url } permission = 'can-view-trees' role = 'user' label = { link . text } >
25- < i className = { link . faIcon } /> { link . text }
27+ < i className = { link . faIcon } /> { link . text } { badge }
2628 </ Link >
2729 </ li >
2830 )
@@ -40,20 +42,24 @@ class Header extends BaseComponent {
4042 if ( this . props . menuItems ) {
4143 const linkElements = this . props . menuItems . map ( ( link ) => {
4244 if ( link . children && link . children . length > 0 ) {
45+ const badge = link . badgeCount > 0 ? < span className = { `badge ${ link . badgeClass } ` } > { link . badgeCount } </ span > : null
46+
4347 return (
4448 < li className = 'nav-item dropdown' >
4549 < a className = 'nav-link dropdown-toggle' href = '#' id = { `${ link . text } Dropdown` }
4650 data-toggle = 'dropdown' aria-haspopup = 'true' aria-expanded = 'false' >
47- < i className = { link . faIcon } /> { link . text }
51+ < i className = { link . faIcon } /> { link . text } { badge }
4852 </ a >
4953 { this . renderMenuItemChildren ( link . text , link . children ) }
5054 </ li >
5155 )
5256 } else {
57+ const badge = link . badgeCount > 0 ? < span className = { `badge ${ link . badgeClass } ` } > { link . badgeCount } </ span > : null
58+
5359 return (
5460 < li key = { link . text } className = 'nav-item' >
5561 < Link key = { link . text } to = { link . url } className = 'nav-link' label = { link . text } >
56- < i className = { link . faIcon } aria-hidden = 'true' /> { link . text }
62+ < i className = { link . faIcon } aria-hidden = 'true' /> { link . text } { badge }
5763 </ Link >
5864 </ li >
5965 )
0 commit comments