0
0
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:
G.Ambatte
2021-01-23 00:36:10 +13:00
parent ba600f5da6
commit e367cb2152
4 changed files with 38 additions and 0 deletions

View 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;