From 8a4e1063a7dce0f1cfd5114e6a8b44b205593693 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Fri, 7 Sep 2018 10:55:29 -0400 Subject: [PATCH] add simple component for authError --- embark-ui/src/components/AuthError.js | 24 ++++++++++++++++++++++++ embark-ui/src/containers/AppContainer.js | 14 ++------------ 2 files changed, 26 insertions(+), 12 deletions(-) create mode 100644 embark-ui/src/components/AuthError.js diff --git a/embark-ui/src/components/AuthError.js b/embark-ui/src/components/AuthError.js new file mode 100644 index 000000000..38eaccceb --- /dev/null +++ b/embark-ui/src/components/AuthError.js @@ -0,0 +1,24 @@ +import PropTypes from "prop-types"; +import React from 'react'; +import {Page, Alert, Form, Button} from "tabler-react"; + +const AuthError = ({error}) => { + return + + {error} + +
+ + + +
; +}; + +AuthError.propTypes = { + error: PropTypes.string.isRequired +}; + +export default AuthError; + diff --git a/embark-ui/src/containers/AppContainer.js b/embark-ui/src/containers/AppContainer.js index 928983d85..3480d5321 100644 --- a/embark-ui/src/containers/AppContainer.js +++ b/embark-ui/src/containers/AppContainer.js @@ -2,9 +2,9 @@ import PropTypes from "prop-types"; import {connect} from 'react-redux'; import React, {Component} from 'react'; import {withRouter} from "react-router-dom"; -import {Alert, Page, Form, Button} from "tabler-react"; import routes from '../routes'; +import AuthError from '../components/AuthError'; import queryString from 'query-string'; import { @@ -52,17 +52,7 @@ class AppContainer extends Component { render() { if (this.state.authenticateError) { - return - - {this.state.authenticateError} - -
- - - -
; + return ; } return ({routes}); }