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 React from 'react';
|
7 | import PropTypes from 'prop-types';
|
8 |
|
9 | import Collapse from './Collapse';
|
10 | import { prefix } from './utils/bootstrapUtils';
|
11 |
|
12 | var contextTypes = {
|
13 | $bs_navbar: PropTypes.shape({
|
14 | bsClass: PropTypes.string,
|
15 | expanded: PropTypes.bool
|
16 | })
|
17 | };
|
18 |
|
19 | var NavbarCollapse = function (_React$Component) {
|
20 | _inherits(NavbarCollapse, _React$Component);
|
21 |
|
22 | function NavbarCollapse() {
|
23 | _classCallCheck(this, NavbarCollapse);
|
24 |
|
25 | return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
26 | }
|
27 |
|
28 | NavbarCollapse.prototype.render = function render() {
|
29 | var _props = this.props,
|
30 | children = _props.children,
|
31 | props = _objectWithoutProperties(_props, ['children']);
|
32 |
|
33 | var navbarProps = this.context.$bs_navbar || { bsClass: 'navbar' };
|
34 |
|
35 | var bsClassName = prefix(navbarProps, 'collapse');
|
36 |
|
37 | return React.createElement(
|
38 | Collapse,
|
39 | _extends({ 'in': navbarProps.expanded }, props),
|
40 | React.createElement(
|
41 | 'div',
|
42 | { className: bsClassName },
|
43 | children
|
44 | )
|
45 | );
|
46 | };
|
47 |
|
48 | return NavbarCollapse;
|
49 | }(React.Component);
|
50 |
|
51 | NavbarCollapse.contextTypes = contextTypes;
|
52 |
|
53 | export default NavbarCollapse; |
\ | No newline at end of file |