Skip to content

Commit

Permalink
chore(*): mod props
Browse files Browse the repository at this point in the history
  • Loading branch information
暮尘 authored and tao1991123 committed Nov 30, 2018
1 parent d48646e commit 0a6909c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
4 changes: 1 addition & 3 deletions src/progress/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,7 @@

&-underlay {
stroke-width: $progress-circle-underlay-width;
&-normal {
stroke: $progress-circle-underlay-color;
}
stroke: $progress-circle-underlay-color;
}

&-overlay {
Expand Down
20 changes: 8 additions & 12 deletions src/progress/view/progress-circle.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ export default class Circle extends Component {
progressive: PropTypes.bool,
textRender: PropTypes.func,
prefix: PropTypes.string,
className: PropTypes.string
className: PropTypes.string,
color: PropTypes.string,
};

constructor(props) {
Expand Down Expand Up @@ -91,29 +92,24 @@ export default class Circle extends Component {

const pathCls = classNames({
[`${prefix}progress-circle-overlay`]: true,
// [`${prefix}progress-circle-overlay-${state}`]: !progressive && state,
// [`${prefix}progress-circle-overlay-started`]: progressive && percent <= 30,
// [`${prefix}progress-circle-overlay-middle`]: progressive && percent > 30 && percent < 80,
// [`${prefix}progress-circle-overlay-finishing`]: progressive && percent >= 80,
});

const underlayCls = classNames({
[`${prefix}progress-circle-underlay`]: true,
[`${prefix}progress-circle-underlay-normal`]: false,
[`${prefix}progress-circle-overlay-${state}`]: !color && !progressive && state,
[`${prefix}progress-circle-overlay-started`]: !color && progressive && percent <= 30,
[`${prefix}progress-circle-overlay-middle`]: !color && progressive && percent > 30 && percent < 80,
[`${prefix}progress-circle-overlay-finishing`]: !color && progressive && percent >= 80,
});

return (
<div {...others} className={wrapCls}>
<svg className={`${prefix}progress-circle-container`} viewBox={viewBox}>
<path className={underlayCls} d={underlayPath} fillOpacity="0" ref={this._underlayRefHandler} stroke="green"/>
<path className={`${prefix}progress-circle-underlay`} d={underlayPath} fillOpacity="0" ref={this._underlayRefHandler} />
<path
className={pathCls}
d={overlayPath}
fillOpacity="0"
strokeDasharray={overlayStrokeDasharray}
strokeDashoffset={overlayStrokeDashoffset}
ref={this._overlayRefHandler}
stroke="red"
stroke={color}
/>
</svg>
{suffixText ? <div className={`${prefix}progress-circle-text`}>{suffixText}</div> : null}
Expand Down
1 change: 1 addition & 0 deletions src/progress/view/progress-line.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export default class Line extends React.PureComponent {
progressive: PropTypes.bool,
hasBorder: PropTypes.bool,
textRender: PropTypes.func,
color: PropTypes.string,
};

render() {
Expand Down

0 comments on commit 0a6909c

Please sign in to comment.