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-4x login-loader" aria-hidden="true"></i>
            </Col>
        )
    }

}

export default connect()(LoaderContainer);