corrected path link

This commit is contained in:
Florian Scholdei
2019-06-27 13:54:04 +02:00
parent 3d07b6c12b
commit c94998c454
2 changed files with 13 additions and 4 deletions

View File

@@ -5,6 +5,7 @@ import injectSheet from "react-jss";
import classNames from "classnames";
type Props = {
revision: string,
path: string,
baseUrl: string,
classes: any
@@ -18,7 +19,7 @@ const styles = {
class Breadcrumb extends React.Component<Props> {
render() {
const { path, baseUrl, classes } = this.props;
const { revision, path, baseUrl, classes } = this.props;
if (path) {
const paths = path.split("/");
@@ -31,6 +32,7 @@ class Breadcrumb extends React.Component<Props> {
>
<ul>
{paths.map((path, index) => {
const currPath = paths.slice(0, index + 1).join("/");
if (paths.length - 1 === index) {
return (
<li className="is-active" key={index}>
@@ -42,7 +44,9 @@ class Breadcrumb extends React.Component<Props> {
}
return (
<li key={index}>
<Link to={baseUrl + "/" + path}>{path}</Link>
<Link to={baseUrl + "/" + revision + "/" + currPath}>
{path}
</Link>
</li>
);
})}