forked from ant-design/ant-design-mobile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.web.tsx
47 lines (40 loc) · 1.07 KB
/
index.web.tsx
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
import * as React from 'react';
import { PropTypes } from 'react';
import classNames from 'classnames';
import ProgressProps from './ProgressPropsType';
export default class Progress extends React.Component<ProgressProps, any> {
static propTypes = {
prefixCls: PropTypes.string,
position: PropTypes.oneOf(['fixed', 'normal']),
percent: PropTypes.number,
unfilled: PropTypes.string,
};
static defaultProps = {
prefixCls: 'am-progress',
percent: 0,
position: 'fixed',
unfilled: 'show',
};
constructor(props) {
super(props);
this.state = {
};
}
render() {
const {prefixCls, percent, position, unfilled} = this.props;
const percentStyle = {
width: `${percent}%`,
height: 0,
};
const wrapCls = classNames({
[`${prefixCls}-outer`]: true,
[`${prefixCls}-fixed-outer`]: position === 'fixed',
[`${prefixCls}-hide-outer`]: unfilled === 'hide',
});
return (
<div className={wrapCls}>
<div className={`${prefixCls}-bar`} style={percentStyle}></div>
</div>
);
}
}