Created
December 31, 2016 23:12
-
-
Save geetotes/b344191ed18ecc0607b05c87aa007748 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PrettyLoader extends React.Component { | |
render() { | |
let loaderStyles = classNames({ | |
'hidden': this.props.loading | |
}); | |
return( | |
<div> | |
<div className={loaderStyles} /> | |
{this.props.children} | |
</div> | |
</div> | |
) | |
} | |
} | |
function mapStateToProps(state) { | |
return { | |
loading: state.loading | |
}; | |
} | |
exports default connect(mapStateToProps, null)(PrettyLoader) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment