Loader.js 1.16 KB
import React, {Component} from 'react';
import logo from '../img/logo.svg'


class Loader extends Component{
	/*componentDidMount(){

		
	}*/

	render(){
		
		var history=this.props.history
		if(typeof this.props.goTo!=='undefined' && typeof history !== 'undefined'){
			setTimeout(function(){history.replace(this.props.goTo)}.bind(this),2000)
		}

		const className='ajax-loader-ct '+this.props.className
		window.scrollTo(0,0)
		return(
				<div className={className}>
					<header className="">
						<div className="bigContainer">
							<div className="logo ">
								<img src={logo} alt={'logo'} />

							</div>
						</div>
					</header>
					<div className='ajax-loader-wrapper'>
						<div className="loader_spinner"></div>
						<h3>{this.props.heading}</h3>
   					<p>{this.props.subHeading}</p>
					</div>
				</div>
			)
	}
}

/*const Loader = () => (
  <Route componentDidMount={() => {setTimeout(function(){history.push('/solution')},2000)}} render={({ history}) => (

  	<div>
					sono un loader!
				</div>
    <button
      type='button'
      onClick={() => { history.push('/new-location') }}
    >
      Click Me!
    </button>
  )} />
)*/



export default Loader