diff --git a/client/naturalcrit/naturalcrit.jsx b/client/naturalcrit/naturalcrit.jsx index 726b2f6..f8ccb3b 100644 --- a/client/naturalcrit/naturalcrit.jsx +++ b/client/naturalcrit/naturalcrit.jsx @@ -17,6 +17,7 @@ const Naturalcrit = React.createClass({ url: '', domain: '', authToken: '', + environment: '', }; }, @@ -52,14 +53,19 @@ const Naturalcrit = React.createClass({ return accountLink; }, + renderEnviroment: function () { + const env = this.props.environment; + if (env[0] === 'production' && !env[1]) return; // Live site + if (env[0] === 'production' && env[1]) return
PR - {env[1]}
; // PR + return
Local
; // Local + }, + render: function () { - console.log(this.props); - const isLocal = this.props.domain === ".local.naturalcrit.com"; return (
{this.renderAccount()}
-
+ {this.renderEnviroment()}
); }, diff --git a/client/naturalcrit/naturalcrit.less b/client/naturalcrit/naturalcrit.less index 0b4531a..2d50100 100644 --- a/client/naturalcrit/naturalcrit.less +++ b/client/naturalcrit/naturalcrit.less @@ -90,4 +90,17 @@ button { text-decoration: none; color: white; } +} + +.environment { + font-family: 'CodeBold'; + letter-spacing: 2px; + position: fixed; + bottom: 10px; + left: 10px; + background-color: #840000; + padding: 12px 20px; + color: white; + text-transform: uppercase; + text-align: center; } \ No newline at end of file diff --git a/server.js b/server.js index 9cf5fa0..280db76 100644 --- a/server.js +++ b/server.js @@ -55,7 +55,6 @@ app.all('/homebrew*', (req, res) => { return res.redirect(302, 'https://homebrewery.naturalcrit.com' + req.url.replace('/homebrew', '')); }); - const render = require('./scripts/steps/render.js'); const templateFn = require('./client/template.js'); @@ -71,7 +70,8 @@ app.get('*', (req, res) => { url : req.url, user : req.user, //authToken : authToken, - domain : config.get('domain') + domain : config.get('domain'), + environment: [process.env.NODE_ENV,process.env.HEROKU_PR_NUMBER] }) .then((page) => res.send(page)) .catch((err) => console.log(err));