diff --git a/packages/ui/src/components/JobCard/Progress/Progress.module.css b/packages/ui/src/components/JobCard/Progress/Progress.module.css index 4176d082..60bb4da5 100644 --- a/packages/ui/src/components/JobCard/Progress/Progress.module.css +++ b/packages/ui/src/components/JobCard/Progress/Progress.module.css @@ -4,15 +4,12 @@ } .progress circle { - transform-origin: center; transition: stroke-dashoffset 500ms ease-in-out; fill: none; - stroke-width: 8; - stroke-linecap: butt; } .progress text { - font-size: 2.5rem; + font-size: 1.5rem; font-family: inherit; font-weight: 300; fill: #a0aec0; diff --git a/packages/ui/src/components/JobCard/Progress/Progress.tsx b/packages/ui/src/components/JobCard/Progress/Progress.tsx index fdeb78da..fc18d785 100644 --- a/packages/ui/src/components/JobCard/Progress/Progress.tsx +++ b/packages/ui/src/components/JobCard/Progress/Progress.tsx @@ -4,32 +4,35 @@ import cn from 'clsx'; import { Status } from '@bull-board/api/typings/app'; import { STATUSES } from '@bull-board/api/src/constants/statuses'; -const radius = 65; -const circumference = 2 * Math.PI * radius; - interface ProgressProps { percentage: number; + strokeWidth?: number; status: Status; className?: string; } -export const Progress = ({ percentage, status, className }: ProgressProps) => { - const circleProps = { - cx: 70, - cy: 70, - r: radius, +export const Progress = ({ percentage, status, className, strokeWidth = 6 }: ProgressProps) => { + const commonProps = { + cx: '50%', + cy: '50%', + r: `calc(50% - ${strokeWidth / 2}px)`, + strokeWidth, + ['transform-origin']: 'center', }; return ( - - + + - + {Math.round(percentage)}%