1 | 'use strict';
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 |
|
7 | var _templateObject = _taggedTemplateLiteral(['\n display: flex;\n margin: 0 auto;\n justify-content: center;\n background: ', ';\n border: 1px solid ', ';\n border-radius: 3px;\n box-shadow: 0px 2px 0px 0px rgba(0,0,0,0.10);\n padding: 2px;\n'], ['\n display: flex;\n margin: 0 auto;\n justify-content: center;\n background: ', ';\n border: 1px solid ', ';\n border-radius: 3px;\n box-shadow: 0px 2px 0px 0px rgba(0,0,0,0.10);\n padding: 2px;\n']);
|
8 |
|
9 | var _styledComponents = require('styled-components');
|
10 |
|
11 | var _styledComponents2 = _interopRequireDefault(_styledComponents);
|
12 |
|
13 | var _react = require('react');
|
14 |
|
15 | var _react2 = _interopRequireDefault(_react);
|
16 |
|
17 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
18 |
|
19 | function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
20 |
|
21 | var Container = _styledComponents2.default.nav(_templateObject, function (props) {
|
22 | return props.theme.background;
|
23 | }, function (props) {
|
24 | return props.theme.light;
|
25 | });
|
26 |
|
27 | var TabList = function TabList(_ref, context) {
|
28 | var children = _ref.children;
|
29 | return _react2.default.createElement(
|
30 | Container,
|
31 | null,
|
32 | _react.Children.map(children, function (child, key) {
|
33 | return (0, _react.cloneElement)(child, {
|
34 | key: key,
|
35 | index: key,
|
36 | active: key === context.currentTab
|
37 | });
|
38 | })
|
39 | );
|
40 | };
|
41 |
|
42 | TabList.propTypes = {
|
43 | children: _react.PropTypes.node.isRequired
|
44 | };
|
45 |
|
46 | TabList.contextTypes = {
|
47 | currentTab: _react.PropTypes.number
|
48 | };
|
49 |
|
50 | exports.default = TabList; |
\ | No newline at end of file |