feat(containers/AppContainers): make use of new LoginLayout

This commit is contained in:
Pascal Precht 2018-10-10 16:58:55 +02:00
parent c1b9760502
commit 0baf0526b1
No known key found for this signature in database
GPG Key ID: 0EE28D8D6FD85D7D

View File

@ -5,6 +5,7 @@ import {withRouter} from "react-router-dom";
import routes from '../routes'; import routes from '../routes';
import Unauthenticated from '../components/Unauthenticated'; import Unauthenticated from '../components/Unauthenticated';
import Layout from "../components/Layout"; import Layout from "../components/Layout";
import LoginLayout from '../components/LoginLayout';
import { import {
authenticate, fetchCredentials, logout, authenticate, fetchCredentials, logout,
@ -62,12 +63,18 @@ class AppContainer extends Component {
render() { render() {
return ( return (
<React.Fragment>
{this.shouldRenderUnauthenticated() ?
<LoginLayout>
<Unauthenticated credentials={this.props.credentials} authenticate={this.props.authenticate} error={this.props.authenticationError} />
</LoginLayout>
:
<Layout location={this.props.location} logout={this.props.logout} credentials={this.props.credentials}> <Layout location={this.props.location} logout={this.props.logout} credentials={this.props.credentials}>
{this.shouldRenderUnauthenticated() ? <Unauthenticated credentials={this.props.credentials} <React.Fragment>{routes}</React.Fragment>
authenticate={this.props.authenticate}
error={this.props.authenticationError} /> : <React.Fragment>{routes}</React.Fragment>}
</Layout> </Layout>
); }
</React.Fragment>
)
} }
} }