-
Notifications
You must be signed in to change notification settings - Fork 3
/
Spinner.js
45 lines (41 loc) · 895 Bytes
/
Spinner.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
var React = require('react');
/**
* @class Spinner
*
* @memberOf GlobalComponents
* @see {@link GlobalComponents}
*/
var Spinner = React.createClass({
propTypes: {
type : React.PropTypes.string,
classes : React.PropTypes.string,
text : React.PropTypes.string
},
/**
* Map easy name to class name
* @memberOf GlobalComponents.Spinner
*/
spinnerTypes: {
spinner : 'spinner-loader',
throbber : 'throbber-loader',
hexdots : 'hexdots-loader',
whirly : 'whirly-loader',
dots : 'dots-loader',
circles : 'circles-loader'
},
/**
* Renders the spiner to the page
*
* @memberOf GlobalComponents.Spinner
*
* @return {jsx}
*/
render: function () {
return (
<div className={this.spinnerTypes[this.props.type || 'spinner'] + ' ' + this.props.classes}>
{this.props.text || 'Loading...'}
</div>
);
}
});
module.exports = Spinner;