Skip to content

Commit

Permalink
fix(Progress): 修改CircleProgress的样式问题 (#2156)
Browse files Browse the repository at this point in the history
* fix: 环形进度条实现自定义模式

* fix: 修改CircleProgress的颜色问题

* fix: 更新storybook
  • Loading branch information
Ryan Zhang committed Jun 8, 2023
1 parent 7bd8558 commit 4cf3ef0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/progress/ProgressCircle.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import { usePrefixCls } from '@gio-design/utils';
import classNames from 'classnames';
import { ProgressProps } from './interface';

const sizeMapping = {
Expand Down Expand Up @@ -35,7 +36,12 @@ const ProgressCircle: React.FC<ProgressProps> = ({
const perimeter = Math.PI * r * 2;
const strokeDashOffset = perimeter - (perimeter * 75) / 100;
return (
<div data-testid="progress" className={`${prefixCls} ${prefixCls}-${status}`} style={style} {...rest}>
<div
data-testid="progress"
className={classNames(prefixCls, { [`${prefixCls}-${status}`]: !strokeColor })}
style={style}
{...rest}
>
<svg width={width} height={width} viewBox={`${-width / 2} ${-width / 2} ${width} ${width}`}>
<circle
cx="0"
Expand Down
3 changes: 2 additions & 1 deletion src/progress/demos/Progress.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,9 @@ export const Circle: Story<ProgressProps> = () => (
circleWidth={200}
strokeWidth={10}
strokeLinecap="butt"
strokeColor="#11123f"
strokeColor="#00123f"
trailColor="#ddd"
showText // default
/>
</>
);

1 comment on commit 4cf3ef0

@vercel
Copy link

@vercel vercel bot commented on 4cf3ef0 Jun 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

gio-design – ./

gio-design-growingio.vercel.app
gio-design-git-master-growingio.vercel.app
gio-design.vercel.app

Please sign in to comment.