Replaced login screen with loader, wile validating access token
This commit is contained in:
27
frontend/src/containers/LoaderContainer.jsx
Normal file
27
frontend/src/containers/LoaderContainer.jsx
Normal file
@@ -0,0 +1,27 @@
|
||||
import React, { Component } from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import './loaderContainer.css';
|
||||
import { validateAccessToken } from '../actions/login/authActions';
|
||||
import {
|
||||
Col
|
||||
} from 'reactstrap';
|
||||
|
||||
class LoaderContainer extends Component {
|
||||
|
||||
componentDidMount() {
|
||||
if (localStorage.accessToken) {
|
||||
this.props.dispatch(validateAccessToken());
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Col xl="12" className="loader">
|
||||
<i className="fa fa-spinner fa-spin fa-8x login-loader" aria-hidden="true"></i>
|
||||
</Col>
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default connect()(LoaderContainer);
|
||||
Reference in New Issue
Block a user