Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 1 | import React from 'react'; |
| 2 | import {connect} from 'react-redux'; |
| 3 | |
| 4 | const mapStateToProps = ({loader}) => { |
| 5 | return { |
| 6 | isLoading: loader.isLoading |
| 7 | }; |
| 8 | }; |
| 9 | |
| 10 | class Loader extends React.Component { |
| 11 | |
| 12 | static propTypes = { |
| 13 | isLoading: React.PropTypes.bool.isRequired |
| 14 | }; |
| 15 | |
| 16 | static defaultProps = { |
| 17 | isLoading: false |
| 18 | }; |
| 19 | |
| 20 | render() { |
| 21 | let {isLoading} = this.props; |
| 22 | |
| 23 | return ( |
| 24 | <div className='onboarding-loader'> |
| 25 | { |
| 26 | isLoading && <div className='onboarding-loader-backdrop'> |
| 27 | <div className='tlv-loader large'></div> |
| 28 | </div> |
| 29 | } |
| 30 | </div> |
| 31 | ); |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | export default connect(mapStateToProps) (Loader); |