fix(client): SideNav, if more than 1 child is expanded, only the first is shown, the rest disappear

pull/35211/head
Valeriy S 2019-01-28 17:16:25 +03:00 committed by mrugesh mohapatra
parent c36ee82443
commit d13cb03810
1 changed files with 1 additions and 8 deletions

View File

@ -74,17 +74,10 @@ class NavPanel extends Component {
renderBody() {
const { hasChildren, children, isExpanded } = this.props;
const childrenWithChildren = children.filter(child => child.props.children);
const uniqueChildren = children.filter(
child =>
!childrenWithChildren.some(
(potentialDupe, index) => index > 0 && potentialDupe.key === child.key
)
);
return (
<div className={isExpanded ? 'body' : ''}>
<ul className='navPanelUl'>
{hasChildren ? uniqueChildren : <NoArticles />}
{hasChildren ? children : <NoArticles />}
</ul>
</div>
);