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
1 changed files with 13 additions and 6 deletions

View File

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