MCSM: компонент Tabs
This commit is contained in:
@@ -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({
|
var ServerInfo = React.createClass({
|
||||||
getInitialState: function(){return {
|
getInitialState: function(){return {
|
||||||
title: null,
|
title: null,
|
||||||
@@ -44,6 +57,7 @@ var ServerInfo = React.createClass({
|
|||||||
return(
|
return(
|
||||||
ce('div', null,
|
ce('div', null,
|
||||||
ce('h2', {style: {'margin-top': '0px'}}, this.state.title),
|
ce('h2', {style: {'margin-top': '0px'}}, this.state.title),
|
||||||
|
ce(Tabs, {tabs: ['Онлайн1', 'Консоль2']}),
|
||||||
ce(NvLineChart, {datum: [{
|
ce(NvLineChart, {datum: [{
|
||||||
key: 'Online players',
|
key: 'Online players',
|
||||||
color: '#37d668',
|
color: '#37d668',
|
||||||
|
|||||||
Reference in New Issue
Block a user