breadcrumbs

This commit is contained in:
Delucse
2020-08-31 13:53:39 +02:00
parent ab95f9eee6
commit d379489a91
3 changed files with 36 additions and 2 deletions
+25
View File
@@ -0,0 +1,25 @@
import React, { Component } from 'react';
import { Link } from 'react-router-dom';
import Breadcrumbs from '@material-ui/core/Breadcrumbs';
import Typography from '@material-ui/core/Typography';
class MyBreadcrumbs extends Component {
render() {
return (
this.props.content && this.props.content.length > 1 ?
<Breadcrumbs separator="›">
{this.props.content.splice(0, this.props.content.length-1).map((content, i) => (
<Link to={content.link} style={{textDecoration: 'none'}}>
<Typography color="secondary">{content.title}</Typography>
</Link>
))}
<Typography color="textPrimary">{this.props.content.slice(-1)[0].title}</Typography>
</Breadcrumbs>
: null
);
};
}
export default MyBreadcrumbs;