summaryrefslogtreecommitdiffstats
path: root/src/utils
diff options
context:
space:
mode:
authorSteve Thomas <steve.thomas@amdocs.com>2018-02-05 11:54:23 -0500
committerSteve Thomas <steve.thomas@amdocs.com>2018-02-05 13:29:46 -0500
commitc89060158fab7394c3bddc5eacb0411dbb13785c (patch)
tree5fa03163e71167f44ed761b2772b6653f0d656c3 /src/utils
parentf42261a2cd0582e0209018c23816681e146ea97d (diff)
Correcting spinner
Change-Id: I0531805d63a9d5b8ac6a161281845a6b8cc1f4af Issue-ID: AAI-732 Signed-off-by: Steve Thomas <steve.thomas@amdocs.com>
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/SpinnerContainer.jsx30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/utils/SpinnerContainer.jsx b/src/utils/SpinnerContainer.jsx
new file mode 100644
index 0000000..448999c
--- /dev/null
+++ b/src/utils/SpinnerContainer.jsx
@@ -0,0 +1,30 @@
+import React, { Component } from 'react';
+import { ClipLoader } from 'react-spinners';
+import {COLOR_BLUE} from 'utils/GlobalConstants.js';
+
+class SpinnerContainer extends Component {
+ render() {
+ // if loading, show content as busy (ex: grey out)
+ const spinnerContentClass = this.props.loading ? 'spinner-content' : '';
+ return (
+ <div className='spinner-container'>
+ <div className='spinner'>
+ <ClipLoader color={COLOR_BLUE} loading={this.props.loading} />
+ </div>
+ <div className={spinnerContentClass}>
+ {this.props.children}
+ </div>
+ </div>
+ );
+ }
+}
+export default SpinnerContainer;
+
+SpinnerContainer.propTypes = {
+ loading: React.PropTypes.bool
+};
+
+SpinnerContainer.defaultProps = {
+ loading: false
+};
+