1 | 'use strict';
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 |
|
7 | var _react = require('react');
|
8 |
|
9 | var _react2 = _interopRequireDefault(_react);
|
10 |
|
11 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
12 |
|
13 | var TabContent = function TabContent(_ref, context) {
|
14 | var children = _ref.children;
|
15 | return _react2.default.createElement(
|
16 | 'div',
|
17 | null,
|
18 | _react.Children.map(children, function (child, key) {
|
19 | return (0, _react.cloneElement)(child, {
|
20 | key: key,
|
21 | active: context.currentTab === key
|
22 | });
|
23 | })
|
24 | );
|
25 | };
|
26 |
|
27 | TabContent.propTypes = {
|
28 | children: _react.PropTypes.node.isRequired
|
29 | };
|
30 |
|
31 | TabContent.contextTypes = {
|
32 | currentTab: _react.PropTypes.number
|
33 | };
|
34 |
|
35 | exports.default = TabContent; |
\ | No newline at end of file |