1 | import _extends from 'babel-runtime/helpers/extends';
|
2 | import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
|
3 | import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
|
4 | import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
|
5 | import _inherits from 'babel-runtime/helpers/inherits';
|
6 | import classNames from 'classnames';
|
7 | import React from 'react';
|
8 | import PropTypes from 'prop-types';
|
9 |
|
10 | import SafeAnchor from './SafeAnchor';
|
11 |
|
12 | var propTypes = {
|
13 | |
14 |
|
15 |
|
16 | active: PropTypes.bool,
|
17 | |
18 |
|
19 |
|
20 | href: PropTypes.string,
|
21 | |
22 |
|
23 |
|
24 | title: PropTypes.node,
|
25 | |
26 |
|
27 |
|
28 | target: PropTypes.string
|
29 | };
|
30 |
|
31 | var defaultProps = {
|
32 | active: false
|
33 | };
|
34 |
|
35 | var BreadcrumbItem = function (_React$Component) {
|
36 | _inherits(BreadcrumbItem, _React$Component);
|
37 |
|
38 | function BreadcrumbItem() {
|
39 | _classCallCheck(this, BreadcrumbItem);
|
40 |
|
41 | return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
42 | }
|
43 |
|
44 | BreadcrumbItem.prototype.render = function render() {
|
45 | var _props = this.props,
|
46 | active = _props.active,
|
47 | href = _props.href,
|
48 | title = _props.title,
|
49 | target = _props.target,
|
50 | className = _props.className,
|
51 | props = _objectWithoutProperties(_props, ['active', 'href', 'title', 'target', 'className']);
|
52 |
|
53 |
|
54 |
|
55 |
|
56 | var linkProps = { href: href, title: title, target: target };
|
57 |
|
58 | return React.createElement(
|
59 | 'li',
|
60 | { className: classNames(className, { active: active }) },
|
61 | active ? React.createElement('span', props) : React.createElement(SafeAnchor, _extends({}, props, linkProps))
|
62 | );
|
63 | };
|
64 |
|
65 | return BreadcrumbItem;
|
66 | }(React.Component);
|
67 |
|
68 | BreadcrumbItem.propTypes = propTypes;
|
69 | BreadcrumbItem.defaultProps = defaultProps;
|
70 |
|
71 | export default BreadcrumbItem; |
\ | No newline at end of file |