Use ES6 spread operator instead of .concat for nav items
parent
3622ed91c5
commit
99c6636152
|
@ -34,28 +34,21 @@ const SideNav = React.createClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
renderUserMenuBlockWithCustomLinks(customLinks, logoutLink) {
|
renderUserMenuBlockWithCustomLinks(customLinks, logoutLink) {
|
||||||
return [<NavHeader key={0} title="User" />].concat(
|
return [
|
||||||
customLinks
|
<NavHeader key={0} title="User" />,
|
||||||
.map(({name, url}, i) =>
|
...customLinks.map(({name, url}, i) =>
|
||||||
<NavListItem
|
<NavListItem key={i + 1} useAnchor={true} isExternal={true} link={url}>
|
||||||
key={i + 1}
|
{name}
|
||||||
useAnchor={true}
|
</NavListItem>
|
||||||
isExternal={true}
|
),
|
||||||
link={url}
|
<NavListItem
|
||||||
>
|
key={customLinks.length + 1}
|
||||||
{name}
|
useAnchor={true}
|
||||||
</NavListItem>
|
link={logoutLink}
|
||||||
)
|
>
|
||||||
.concat(
|
Logout
|
||||||
<NavListItem
|
</NavListItem>,
|
||||||
key={customLinks.length + 1}
|
]
|
||||||
useAnchor={true}
|
|
||||||
link={logoutLink}
|
|
||||||
>
|
|
||||||
Logout
|
|
||||||
</NavListItem>
|
|
||||||
)
|
|
||||||
)
|
|
||||||
},
|
},
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
Loading…
Reference in New Issue