UNPKG

1.4 kBJavaScriptView Raw
1import _extends from 'babel-runtime/helpers/extends';
2import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
3import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
4import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
5import _inherits from 'babel-runtime/helpers/inherits';
6import classNames from 'classnames';
7import React from 'react';
8import PropTypes from 'prop-types';
9
10import { prefix } from './utils/bootstrapUtils';
11
12var contextTypes = {
13 $bs_navbar: PropTypes.shape({
14 bsClass: PropTypes.string
15 })
16};
17
18var NavbarHeader = function (_React$Component) {
19 _inherits(NavbarHeader, _React$Component);
20
21 function NavbarHeader() {
22 _classCallCheck(this, NavbarHeader);
23
24 return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
25 }
26
27 NavbarHeader.prototype.render = function render() {
28 var _props = this.props,
29 className = _props.className,
30 props = _objectWithoutProperties(_props, ['className']);
31
32 var navbarProps = this.context.$bs_navbar || { bsClass: 'navbar' };
33
34 var bsClassName = prefix(navbarProps, 'header');
35
36 return React.createElement('div', _extends({}, props, { className: classNames(className, bsClassName) }));
37 };
38
39 return NavbarHeader;
40}(React.Component);
41
42NavbarHeader.contextTypes = contextTypes;
43
44export default NavbarHeader;
\No newline at end of file