mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-30 08:52:38 +00:00
Initial commit - adds a New button to the Nav bar on the Home, User, and Edit pages.
This commit is contained in:
32
client/homebrew/navbar/newbrew.navitem.jsx
Normal file
32
client/homebrew/navbar/newbrew.navitem.jsx
Normal file
@@ -0,0 +1,32 @@
|
||||
const React = require('react');
|
||||
const createClass = require('create-react-class');
|
||||
const Nav = require('naturalcrit/nav/nav.jsx');
|
||||
|
||||
const NewBrew = createClass({
|
||||
|
||||
getInitialState : function() {
|
||||
return {
|
||||
url : ''
|
||||
};
|
||||
},
|
||||
|
||||
componentDidMount : function(){
|
||||
if(typeof window !== 'undefined'){
|
||||
this.setState({
|
||||
url : window.location.href
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
render : function(){
|
||||
if(global.account){
|
||||
return <Nav.item href='/new' color='purple' icon='fa-plus-square'>
|
||||
new
|
||||
</Nav.item>;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = NewBrew;
|
||||
Reference in New Issue
Block a user