fix: Deeply nested document breadcrumb menu

This commit is contained in:
Tom Moor
2019-06-25 23:21:04 -07:00
parent 5f8956e5c6
commit f0de382367
4 changed files with 88 additions and 28 deletions

View File

@ -0,0 +1,25 @@
// @flow
import * as React from 'react';
import { Link } from 'react-router-dom';
import { DropdownMenu, DropdownMenuItem } from 'components/DropdownMenu';
type Props = {
label: React.Node,
path: Array<any>,
};
export default class BreadcrumbMenu extends React.Component<Props> {
render() {
const { path } = this.props;
return (
<DropdownMenu label={this.props.label} position="center">
{path.map(item => (
<DropdownMenuItem as={Link} to={item.url} key={item.id}>
{item.title}
</DropdownMenuItem>
))}
</DropdownMenu>
);
}
}