feat(v2): support external links and linking to docs from other sidebars (#1052)

* feat(sidebar): support external links and linking to docs from other sidebars

* Update styles.css
This commit is contained in:
Sviatoslav 2018-10-25 07:01:39 +03:00 committed by Yangshun Tay
parent edde297504
commit a2d3f26722
8 changed files with 466 additions and 139 deletions

View file

@ -0,0 +1,32 @@
import React from 'react';
import classnames from 'classnames';
import styles from './styles.css';
export default function SidebarCategory({
label,
items,
subCategory,
renderItem,
}) {
const Heading = subCategory ? 'h4' : 'h3';
return (
<div
className={classnames(styles.sidebarGroup, {
[styles.sidebarSubGroup]: subCategory,
})}
key={label}>
<Heading
className={classnames(
styles.sidebarItem,
styles.sidebarGroupTitle,
styles.sidebarGroupCategoryTitle,
)}>
{label}
</Heading>
<ul className={styles.sidebarList}>{items.map(renderItem)}</ul>
</div>
);
}