var React = require('react'),
Overlay = require('./overlay.jsx'),
Mui = require('material-ui'),
Paper = Mui.Paper,
Menu = require('./menu.jsx');
var RightNav = React.createClass({
propTypes: {
docked: React.PropTypes.bool,
header: React.PropTypes.element,
onChange: React.PropTypes.func,
menuItems: React.PropTypes.array.isRequired,
selectedIndex: React.PropTypes.number
},
getDefaultProps: function() {
return {
docked: true
};
},
getInitialState: function() {
return {
open: this.props.docked,
modal: false
};
},
toggle: function() {
this.setState({ open: !this.state.open });
return this;
},
close: function() {
this.setState({ open: false });
return this;
},
open: function() {
this.setState({ open: true });
return this;
},
render: function() {
var classes = 'mui-right-nav';
if (!this.state.open) {
classes += ' mui-closed';
}
var selectedIndex = this.props.selectedIndex;
var overlay;
if (!this.props.docked) overlay =