diff --git a/static/src/js/components/breadcrumbs.js b/static/src/js/components/breadcrumbs.js index 1224430..294feb5 100644 --- a/static/src/js/components/breadcrumbs.js +++ b/static/src/js/components/breadcrumbs.js @@ -1,33 +1,26 @@ import React from 'react'; -let { - Breadcrumb, - BreadcrumbItem -} = require('react-bootstrap'); - export default class Breadcrumbs extends React.Component { + constructor() { + super(); + this.urlParts = Object.freeze(location.pathname.split('/').slice(1, -1)); + } + render() { - const parts = location.pathname.split('/').slice(1, -1); var elements = []; - for (var i = 0; i < parts.length; i++) { + for (var i = 0; i < this.urlParts.length; i++) { var dirs = []; for (var j = 0; j <= i; j++) { - dirs.push(parts[j]); + dirs.push(this.urlParts[j]); } - if (i === (parts.length - 1)) { + if (i === (this.urlParts.length - 1)) { elements.push( -