/** @jsx React.DOM */
var MainMenu = React.createClass({
toggleEventLog() {
SettingsActions.update({
showEventLog: !this.props.settings.showEventLog
});
},
render(){
return (
);
}
});
var ToolsMenu = React.createClass({
render(){
return Tools Menu
;
}
});
var ReportsMenu = React.createClass({
render(){
return Reports Menu
;
}
});
var _Header_Entries = {
main: {
title: "Traffic",
route: "main",
menu: MainMenu
},
tools: {
title: "Tools",
route: "main",
menu: ToolsMenu
},
reports: {
title: "Visualization",
route: "reports",
menu: ReportsMenu
}
};
var Header = React.createClass({
getInitialState(){
return {
active: "main"
};
},
handleClick(active){
this.setState({active: active});
ReactRouter.transitionTo(_Header_Entries[active].route);
return false;
},
handleFileClick(){
console.log("File click");
},
render(){
var header = [];
for(var item in _Header_Entries){
var classes = this.state.active == item ? "active" : "";
header.push({ _Header_Entries[item].title });
}
var menu = _Header_Entries[this.state.active].menu({
settings: this.props.settings
});
return (
);
}
});