This commit is contained in:
insanity 2017-07-25 15:26:04 +09:00
commit 987995e026

View File

@ -61,12 +61,16 @@ export class TitleBar extends React.Component<Props, State> {
public renderBreadcrumb(): JSX.Element[] {
let elems: JSX.Element[] = new Array();
let pathArr = this.props.location.split('/');
let index: number = 0;
for (let item of pathArr) {
if (item !== '' && !item.match(/^\d+$/)) {
let path = '/' + item;
elems.push(<Breadcrumb.Section onClick={this.handleBreadcrumb.bind(this, path)}>{this.capitalizeFirst(item)}</Breadcrumb.Section>);
elems.push(<Breadcrumb.Divider />);
elems.push(
<Breadcrumb.Section key={index++} onClick={this.handleBreadcrumb.bind(this, path)}>
{this.capitalizeFirst(item)}
</Breadcrumb.Section>);
elems.push(<Breadcrumb.Divider key={index++}/>);
}
}
return elems;