const React = require('react'); const _ = require('lodash'); const Nav = require('naturalcrit/nav/nav.jsx'); const Navbar = React.createClass({ getInitialState: function() { return { showNonChromeWarning : false, ver : '0.0.0' }; }, componentDidMount: function() { const isChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor); this.setState({ showNonChromeWarning : !isChrome, ver : window.version }) }, renderChromeWarning : function(){ if(!this.state.showNonChromeWarning) return; return Optimized for Chrome If you are experiencing rendering issues, use Chrome instead }, render : function(){ return The Homebrewery {`v${this.state.ver}`} {this.renderChromeWarning()} {this.props.children} } }); module.exports = Navbar;