UNPKG

@6thquake/react-material

Version:

React components that implement Google's Material Design.

77 lines (69 loc) 1.59 kB
import React from 'react'; import PropTypes from 'prop-types'; import withStyles from '../styles/withStyles'; import { fade } from '../styles/colorManipulator'; const styles = { root: { display: 'inline-block', '@global svg': { verticalAlign: 'middle', width: '0.6em' } }, icon: { padding: '0 3px' } }; class BreadcrumbItem extends React.PureComponent { render() { const { path, icon, name, notLink, classes, color = 'inherit', children } = this.props; let item = children; if (!children) { if (!notLink) { item = React.createElement("a", { href: path }, icon ? React.createElement("i", { className: classes.icon }, icon) : null, React.createElement("font", null, name)); } else { item = React.createElement("span", null, React.createElement("i", { className: classes.icon }, icon), React.createElement("font", null, name)); } } return React.createElement("div", { className: classes.root, key: path }, item); } } process.env.NODE_ENV !== "production" ? BreadcrumbItem.propTypes = { /** * The routing icon */ icon: PropTypes.element, /** * The routing name */ name: PropTypes.string, /** * Whether the routing is a link or not */ notLink: PropTypes.bool, /** * The routing path name */ path: PropTypes.string } : void 0; BreadcrumbItem.defaultProps = {}; export default withStyles(styles, { name: 'RMBreadcrumbItem' })(BreadcrumbItem);