diff --git a/src/ts/@overflow/app/views/layout/TitleBar.tsx b/src/ts/@overflow/app/views/layout/TitleBar.tsx index ed47a51..71edf58 100644 --- a/src/ts/@overflow/app/views/layout/TitleBar.tsx +++ b/src/ts/@overflow/app/views/layout/TitleBar.tsx @@ -52,18 +52,22 @@ export class TitleBar extends React.Component { return this.capitalizeFirst(pathArr[1]); } + public handleBreadcrumb = (path: string) => { + console.log(path); + this.props.onRedirect(path); + } + + // temporary public renderBreadcrumb(): JSX.Element[] { let elems: JSX.Element[] = new Array(); let pathArr = this.props.location.split('/'); - if (pathArr[1].indexOf('probe') > -1 || pathArr[1].indexOf('sensor') > -1) { - elems.push(Monitoring); - elems.push(); - elems.push({this.capitalizeFirst(pathArr[1])}); - }else if (pathArr[1].indexOf('target') > -1) { - elems.push(Infrastructure); - elems.push(); - elems.push({this.capitalizeFirst(pathArr[1])}); + for (let item of pathArr) { + if (item !== '' && !item.match(/^\d+$/)) { + let path = '/' + item; + elems.push({this.capitalizeFirst(item)}); + elems.push(); + } } return elems; } @@ -75,7 +79,7 @@ export class TitleBar extends React.Component {
{this.showTitle()} - Home + Home {this.renderBreadcrumb()}