Skip to content

Instantly share code, notes, and snippets.

@tugberkugurlu
Created September 11, 2016 21:18
Show Gist options
  • Save tugberkugurlu/7a0702066ec303113519934cd99a2055 to your computer and use it in GitHub Desktop.
Save tugberkugurlu/7a0702066ec303113519934cd99a2055 to your computer and use it in GitHub Desktop.
import 'loaders.css/loaders.css';
import './index.scss';
import React, { PropTypes } from 'react';
const LoadingIndicator = React.createClass({
propTypes: {
children: PropTypes.array.isRequired,
isLoading: PropTypes.bool.isRequired
},
render: function() {
if(this.props.isLoading) {
return <div className="loading-indicator-holder">
<div className="loader-inner square-spin inner"><div></div></div>
</div>;
}
return <div>{this.props.children}</div>;
}
});
export default LoadingIndicator;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment