Skip to content

Commit

Permalink
Merge pull request #98 from meetfranz/feature/dev-mode-notice
Browse files Browse the repository at this point in the history
Add dev mode notice to login and signup
  • Loading branch information
adlk committed Oct 24, 2017
2 parents 59bc64a + 880da2d commit 6e1447c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/components/auth/Login.js
Expand Up @@ -3,11 +3,14 @@ import PropTypes from 'prop-types';
import { observer } from 'mobx-react';
import { defineMessages, intlShape } from 'react-intl';

import { isDevMode, useLiveAPI } from '../../environment';
import Form from '../../lib/Form';
import { required, email } from '../../helpers/validation-helpers';
import Input from '../ui/Input';
import Button from '../ui/Button';
import Link from '../ui/Link';
import Infobox from '../ui/Infobox';


import { globalError as globalErrorPropType } from '../../prop-types';

Expand Down Expand Up @@ -117,6 +120,11 @@ export default class Login extends Component {
alt=""
/>
<h1>{intl.formatMessage(messages.headline)}</h1>
{isDevMode && !useLiveAPI && (
<Infobox type="warning">
In Dev Mode your data is not persistent. Please use the live app for accesing the production API.
</Infobox>
)}
{isTokenExpired && (
<p className="error-message center">{intl.formatMessage(messages.tokenExpired)}</p>
)}
Expand Down
7 changes: 7 additions & 0 deletions src/components/auth/Signup.js
Expand Up @@ -3,12 +3,14 @@ import PropTypes from 'prop-types';
import { observer } from 'mobx-react';
import { defineMessages, intlShape } from 'react-intl';

import { isDevMode, useLiveAPI } from '../../environment';
import Form from '../../lib/Form';
import { required, email, minLength } from '../../helpers/validation-helpers';
import Input from '../ui/Input';
import Radio from '../ui/Radio';
import Button from '../ui/Button';
import Link from '../ui/Link';
import Infobox from '../ui/Infobox';

import { globalError as globalErrorPropType } from '../../prop-types';

Expand Down Expand Up @@ -145,6 +147,11 @@ export default class Signup extends Component {
alt=""
/>
<h1>{intl.formatMessage(messages.headline)}</h1>
{isDevMode && !useLiveAPI && (
<Infobox type="warning">
In Dev Mode your data is not persistent. Please use the live app for accesing the production API.
</Infobox>
)}
<Radio field={form.$('accountType')} showLabel={false} />
<div className="grid__row">
<Input field={form.$('firstname')} focus />
Expand Down
5 changes: 5 additions & 0 deletions src/styles/infobox.scss
Expand Up @@ -31,6 +31,11 @@
color: #FFF;
}

&.infobox--warning {
background: $theme-brand-warning;
color: #FFF;
}

.mdi {
margin-right: 10px;
}
Expand Down

0 comments on commit 6e1447c

Please sign in to comment.