This repository was archived by the owner on Sep 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 798
/
Copy pathstat-tile.js
executable file
·59 lines (54 loc) · 1.89 KB
/
stat-tile.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
define(
[
'react',
'create-react-class',
],
function (React, createReactClass) {
var StatTile = createReactClass({
getDefaultProps: function() {
return {
color: 'bg-yellow',
icon: 'ion-person-add',
subject: 'Default Subject',
stats: '0',
link: '/default/link'
}
},
render: function() {
var link = '',
stats = <h3> {this.props.stats} </h3>;
if(this.props.link) {
link =
<a href={this.props.link} className="small-box-footer">
More info <i className="fa fa-arrow-circle-right"></i>
</a>;
}
if(this.props.stats.indexOf('%') !== -1) {
var style = {
fontSize: '20px'
};
stats =
<h3>
{this.props.stats.replace(/%/g, '')}
<sup style={style}>%</sup>
</h3>
}
return(
<div className = {"col-lg-"+this.props.width+" col-xs-6"}>
<div className={"small-box "+this.props.theme}>
<div className="inner">
{stats}
<p>{this.props.subject}</p>
</div>
<div className="icon">
<i className={"fa "+this.props.icon}></i>
</div>
{link}
</div>
</div>
)
}
});
return StatTile;
}
)