Merge branch 'master' of https://git.loafle.net/overflow/overflow_app
This commit is contained in:
commit
987995e026
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user