Skip to content

Instantly share code, notes, and snippets.

@geetotes
Created December 31, 2016 23:12
Show Gist options
  • Save geetotes/b344191ed18ecc0607b05c87aa007748 to your computer and use it in GitHub Desktop.
Save geetotes/b344191ed18ecc0607b05c87aa007748 to your computer and use it in GitHub Desktop.
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