-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathIndexLayoutTabBar.js
More file actions
31 lines (23 loc) · 956 Bytes
/
IndexLayoutTabBar.js
File metadata and controls
31 lines (23 loc) · 956 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
'use strict';
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _reactDom = require('react-dom');
var _reactDom2 = _interopRequireDefault(_reactDom);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var TabBarItem = function TabBarItem(props) {
return _react2.default.createElement(
'a',
{ href: props.href, 'data-tab-id': props.id, className: "mdl-layout__tab" + (props.isActive ? " is-active" : "") },
props.content
);
};
var IndexLayoutTabBar = function IndexLayoutTabBar(props) {
return _react2.default.createElement(
'div',
{ className: "mdl-layout__tab-bar mdl-js-ripple-effect" },
props.items.map(function (item) {
return _react2.default.createElement(TabBarItem, { key: item.id, id: item.id, href: "#" + item.id, content: item.content, isActive: item.id == props.activeId });
})
);
};
module.exports = IndexLayoutTabBar;