Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/circle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,17 @@ export class Circle extends Component<CircleProps, CircleState> {
const transition = animate ? `stroke-dashoffset ${animationDuration} ease-out` : undefined;
const strokeLinecap = roundedStroke ? 'round' : 'butt';
const svgSize = responsive ? '100%' : size;

const children = this.props.children
Copy link
Owner

Choose a reason for hiding this comment

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

Can you add this to the existing destructuring above?

return (
<svg width={svgSize} height={svgSize} viewBox="-25 -25 400 400">
<circle stroke={bgColor} cx="175" cy="175" r="175" strokeWidth={lineWidth} fill="none"/>
<circle stroke={progressColor} transform="rotate(-90 175 175)" cx="175" cy="175" r="175" strokeDasharray="1100" strokeWidth={lineWidth} strokeDashoffset="1100" strokeLinecap={strokeLinecap} fill="none" style={{ strokeDashoffset, transition }} onTransitionEnd={onAnimationEnd}/>
{text}
{
children ?
children
:
text
}
</svg>
);
}
Expand Down