fix(client): SideNav, if more than 1 child is expanded, only the first is shown, the rest disappear
parent
c36ee82443
commit
d13cb03810
|
@ -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>
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue