diff --git a/src/ts/@overflow/app/views/layout/TitleBar.tsx b/src/ts/@overflow/app/views/layout/TitleBar.tsx index bca1e7a..953a128 100644 --- a/src/ts/@overflow/app/views/layout/TitleBar.tsx +++ b/src/ts/@overflow/app/views/layout/TitleBar.tsx @@ -96,41 +96,34 @@ export class TitleBar extends React.Component { } public handleBreadcrumb = (path: string) => { - console.log(path); + if(path === '/probe' || path === '/sensor' || path === '/target') { + path = path + 's'; + } this.props.onRedirect(path); } + // temporary public renderBreadcrumb(): JSX.Element[] { - - let options = [ - { - text: 'Probes', - value: 'probes', - }, - { - text: 'Targets', - value: 'targets', - }, - { - text: 'Sensors', - value: 'sensors', - }, - ]; - let elems: JSX.Element[] = new Array(); let pathArr = this.props.location.split('/'); let index: number = 0; - + let path = ''; for (let item of pathArr) { - if (item !== '' && !item.match(/^\d+$/)) { - let path = '/' + item; - elems.push( - - {this.capitalizeFirst(item)} - {/* */} - ); - elems.push(); + if (item !== '') { + path = path + '/' + item; + if (pathArr[pathArr.length - 1] !== item) { + elems.push( + + {this.capitalizeFirst(item)} + ); + elems.push(); + } else { + elems.push( + + {this.capitalizeFirst(item)} + ); + } } } return elems; @@ -144,7 +137,7 @@ export class TitleBar extends React.Component { Home - + {this.renderBreadcrumb()}