Created
September 23, 2015 18:50
-
-
Save ddgromit/0f136a160f7a5f7f76a1 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
// LoadingContainer.js | |
class LoadingContainer extends React.Component { | |
render() { | |
if (this.props.loading) { | |
return ( | |
<div> | |
Loading... | |
</div> | |
); | |
} else if (this.props.error !== null) { | |
return ( | |
<div className="alert alert-danger" role="alert"> | |
<span className="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span> | |
{this.props.error} | |
</div> | |
); | |
} else { | |
return ( | |
<div> | |
{this.props.children} | |
</div> | |
); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment