@@ -22,13 +22,18 @@ interface Props extends React.Props<any> {
2222const Navbar = ( props : Props ) => {
2323 const { bg, variant, navItems } = props
2424
25- const getNavListLinks = ( link : NavLink , index : number ) => (
26- < NavDropdown . Item href = { link . href ? link . href : '' } key = { index } onClick = { link . onClick } >
25+ const getNavListLink = ( link : NavLink , index : number ) => (
26+ < NavDropdown . Item
27+ className = { link . className ? link . className . concat ( ' ' , '' ) : '' }
28+ href = { link . href ? link . href : '' }
29+ key = { index }
30+ onClick = { link . onClick }
31+ >
2732 { link . label }
2833 </ NavDropdown . Item >
2934 )
3035 const getNavSearch = ( search : NavSearch , index : number ) => (
31- < Nav key = { index } >
36+ < Nav className = { search . className ? search . className . concat ( ' ' , '' ) : '' } key = { index } >
3237 < Form inline >
3338 < FormControl
3439 type = "text"
@@ -43,29 +48,46 @@ const Navbar = (props: Props) => {
4348 </ Nav >
4449 )
4550 const getNavLinkList = ( list : NavLinkList , index : number ) => (
46- < NavDropdown title = { list . label } id = "collasible-nav-dropdown" key = { index } >
47- { list . children . map ( ( subLink , i ) => getNavListLinks ( subLink , i ) ) }
51+ < NavDropdown
52+ className = { list . className ? list . className . concat ( ' ' , '' ) : '' }
53+ title = { list . label }
54+ id = "collasible-nav-dropdown"
55+ key = { index }
56+ >
57+ { list . children . map ( ( listLink , i ) => getNavListLink ( listLink , i ) ) }
4858 </ NavDropdown >
4959 )
5060 const getNavHeader = ( header : NavHeader , index : number ) => (
51- < NavbarRB . Brand onClick = { header . onClick } style = { { cursor : 'pointer' } } key = { index } >
61+ < NavbarRB . Brand
62+ className = { header . className ? header . className . concat ( ' ' , '' ) : '' }
63+ onClick = { header . onClick }
64+ style = { { cursor : 'pointer' } }
65+ key = { index }
66+ >
5267 < span style = { { color : header . color } } > { `${ header . label } ` } </ span >
5368 </ NavbarRB . Brand >
5469 )
5570 const getNavIcon = ( icon : NavIcon , index : number ) => (
56- < NavbarRB . Brand onClick = { icon . onClick } style = { { cursor : 'pointer' } } key = { index } >
57- < img
58- alt = { icon . alt }
59- src = { icon . src }
60- width = "28"
61- height = "28"
62- className = "d-inline-block align-top mr-3"
63- />
71+ < NavbarRB . Brand
72+ className = {
73+ icon . className
74+ ? icon . className . concat ( ' ' , 'd-inline-block align-top' )
75+ : 'd-inline-block align-top'
76+ }
77+ onClick = { icon . onClick }
78+ style = { { cursor : 'pointer' } }
79+ key = { index }
80+ >
81+ < img alt = { icon . alt } src = { icon . src } width = "28" height = "28" />
6482 </ NavbarRB . Brand >
6583 )
6684
6785 const getNavLink = ( link : NavLink , index : number ) => (
68- < Nav . Link onClick = { link . onClick } key = { index } >
86+ < Nav . Link
87+ className = { link . className ? link . className . concat ( ' ' , '' ) : '' }
88+ onClick = { link . onClick }
89+ key = { index }
90+ >
6991 { link . label }
7092 </ Nav . Link >
7193 )
0 commit comments