Skip to content

Commit 7a6c346

Browse files
committed
scaffold Statistic and Statistics components
1 parent bed2a79 commit 7a6c346

File tree

2 files changed

+71
-0
lines changed

2 files changed

+71
-0
lines changed

src/views/Statistic/Statistic.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import React, {Component, PropTypes} from 'react';
2+
import classNames from 'classnames';
3+
import getUnhandledProps from 'src/utils/getUnhandledProps';
4+
import META from 'src/utils/Meta';
5+
6+
export default class Statistic extends Component {
7+
static propTypes = {
8+
className: PropTypes.string,
9+
label: PropTypes.node,
10+
value: PropTypes.node,
11+
};
12+
13+
static _meta = {
14+
library: META.library.semanticUI,
15+
name: 'Statistics',
16+
type: META.type.view,
17+
parent: 'Statistic'
18+
};
19+
20+
render() {
21+
const classes = classNames(
22+
'ui',
23+
this.props.className,
24+
'statistic',
25+
);
26+
27+
const props = getUnhandledProps(this);
28+
29+
return (
30+
<div {...props} className={classes}>
31+
<div className='value'>
32+
{this.props.value}
33+
</div>
34+
<div className='label'>
35+
{this.props.label}
36+
</div>
37+
</div>
38+
);
39+
}
40+
}

src/views/Statistic/Statistics.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import React, {Component, PropTypes} from 'react';
2+
import classNames from 'classnames';
3+
import META from 'src/utils/Meta';
4+
5+
export default class Statistics extends Component {
6+
static propTypes = {
7+
children: PropTypes.node,
8+
className: PropTypes.string,
9+
};
10+
11+
static _meta = {
12+
library: META.library.semanticUI,
13+
name: 'Statistics',
14+
type: META.type.view,
15+
parent: 'Statistic'
16+
};
17+
18+
render() {
19+
const classes = classNames(
20+
'sd-buttons',
21+
'ui',
22+
this.props.className,
23+
'buttons'
24+
);
25+
return (
26+
<div {...this.props} className={classes}>
27+
{this.props.children}
28+
</div>
29+
);
30+
}
31+
}

0 commit comments

Comments
 (0)