Archived
0

MCSM: компонент Tabs

This commit is contained in:
2017-05-09 18:40:12 +03:00
parent ca8a6f1514
commit 26b5958913

View File

@@ -32,6 +32,19 @@ var NvLineChart = React.createClass({
}
});
var Tabs = React.createClass({
render: function(){
var tabsElm = [];
this.props.tabs.forEach(function(title, i){
tabsElm.push(ce('li', (i === 0 ? {className: 'active'} : null), ce('a', {href: '#'}, title)));
});
return(
ce('ul', {className: 'nav nav-tabs'}, tabsElm)
)
}
});
var ServerInfo = React.createClass({
getInitialState: function(){return {
title: null,
@@ -44,6 +57,7 @@ var ServerInfo = React.createClass({
return(
ce('div', null,
ce('h2', {style: {'margin-top': '0px'}}, this.state.title),
ce(Tabs, {tabs: ['Онлайн1', 'Консоль2']}),
ce(NvLineChart, {datum: [{
key: 'Online players',
color: '#37d668',