var React = require('react');
var Glyphicon = require('react-bootstrap/lib/Glyphicon');
var Nav = require('react-bootstrap/lib/Nav');
var NavItem = require('react-bootstrap/lib/NavItem');
var Navbar = require('react-bootstrap/lib/Navbar');
var NavDropdown = require('react-bootstrap/lib/NavDropdown');
var MenuItem = require('react-bootstrap/lib/MenuItem');
var Modal = require('react-bootstrap/lib/Modal');
var Button = require('react-bootstrap/lib/Button');
var Input = require('react-bootstrap/lib/Input');
var MenuStore = require('../stores/MenuStore');
JarrNavBar = React.createClass({
getInitialState: function() {
return {is_admin: MenuStore._datas.is_admin,
crawling_method: MenuStore._datas.crawling_method,
showModal: false, modalType: null};
},
buttonFetch: function() {
if(this.state.is_admin && this.state.crawling_method != 'http') {
return (
Fetch
);
}
},
buttonAdmin: function() {
if(this.state.is_admin) {
return (}
id='admin-dropdown'>
);
}
},
getModel: function() {
var heading = null;
var action = null;
var body = null;
if(this.state.modalType == 'addFeed') {
heading = 'Add a new feed';
action = '/feed/bookmarklet';
placeholder = "Site or feed url, we'll sort it out later ;)";
body = ;
} else {
heading = 'Add a new category';
action = '/category/create';
body = ;
}
return (
);
},
close: function() {
this.setState({showModal: false, modalType: null});
},
openAddFeed: function() {
this.setState({showModal: true, modalType: 'addFeed'});
},
openAddCategory: function() {
this.setState({showModal: true, modalType: 'addCategory'});
},
render: function() {
var gl_title = (
Add a new feed
);
return (
{this.getModel()}
JARR
);
},
componentDidMount: function() {
MenuStore.addChangeListener(this._onChange);
},
componentWillUnmount: function() {
MenuStore.removeChangeListener(this._onChange);
},
_onChange: function() {
var datas = MenuStore.getAll();
this.setState({is_admin: datas.is_admin,
crawling_method: datas.crawling_method});
},
});
module.exports = JarrNavBar;