aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-ui/src/nfvo-components/loader/Loader.jsx
blob: cc1ffdb2b3a7853c8362c409e6aa636b0df58fb9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import React from 'react';
import {connect} from 'react-redux';

const mapStateToProps = ({loader}) => {
	return {
		isLoading: loader.isLoading
	};
};

class Loader extends React.Component {

	static propTypes = {
		isLoading: React.PropTypes.bool.isRequired
	};

	static defaultProps = {
		isLoading: false
	};

	render() {
		let {isLoading} = this.props;

		return (
			<div className='onboarding-loader'>
				{
					isLoading && <div className='onboarding-loader-backdrop'>
						<div className='tlv-loader large'></div>
					</div>
				}
			</div>
		);
	}
}

export default connect(mapStateToProps) (Loader);