-
Notifications
You must be signed in to change notification settings - Fork 473
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
53 changes: 53 additions & 0 deletions
53
packages/slimkit-plus-feed/admin/components/common/Breadcrumb.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import React from 'react'; | ||
import PropTypes from "prop-types"; | ||
import { withStyles } from "@material-ui/core/styles"; | ||
|
||
const styles = theme => { | ||
return { | ||
root: { | ||
...theme.typography.subheading | ||
}, | ||
item: { | ||
color: theme.palette.text.secondary, | ||
display: 'inline-block', | ||
float: 'left', | ||
'&:last-child:after': { | ||
display: 'none' | ||
}, | ||
'&:after': { | ||
display: 'inline-block', | ||
float: 'initial', | ||
content: '"/"', | ||
paddingLeft: theme.spacing.unit, | ||
paddingRight: theme.spacing.unit, | ||
color: theme.palette.text.disabled | ||
}, | ||
} | ||
}; | ||
}; | ||
|
||
class Breadcrumb extends React.Component { | ||
|
||
static propTypes = { | ||
classes: PropTypes.object.isRequired, | ||
items: PropTypes.array.isRequired, | ||
className: PropTypes.string | ||
}; | ||
|
||
static defaultProps = { | ||
className: '' | ||
}; | ||
|
||
render() { | ||
let { className, classes, items } = this.props; | ||
return ( | ||
<div className={`${classes.root} ${className}`}> | ||
{ items.map(item => ( | ||
<span key={item} className={classes.item}>{ item }</span> | ||
)) } | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default withStyles(styles)(Breadcrumb); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters