0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 20:42:43 +00:00

Navbar now using global scope

This commit is contained in:
Scott Tolksdorf
2016-11-14 20:15:29 -05:00
parent 4dce90ab41
commit d7463ec28e

View File

@@ -1,25 +1,21 @@
var React = require('react');
var _ = require('lodash');
const React = require('react');
const _ = require('lodash');
var Nav = require('naturalcrit/nav/nav.jsx');
const Nav = require('naturalcrit/nav/nav.jsx');
var Navbar = React.createClass({
getDefaultProps: function() {
const Navbar = React.createClass({
getInitialState: function() {
return {
showNonChromeWarning : false,
ver : '0.0.0'
};
},
getInitialState: function() {
return {
showNonChromeWarning : false
};
},
componentDidMount: function() {
var isChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);
const isChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);
this.setState({
showNonChromeWarning : !isChrome
showNonChromeWarning : !isChrome,
ver : window.version
})
},
@@ -40,7 +36,7 @@ var Navbar = React.createClass({
<Nav.item href='/' className='homebrewLogo'>
<div>The Homebrewery</div>
</Nav.item>
<Nav.item>{`v${this.props.ver}`}</Nav.item>
<Nav.item>{`v${this.state.ver}`}</Nav.item>
{this.renderChromeWarning()}
</Nav.section>