Skip to content

Commit 404b328

Browse files
x0sinaImMohammad20000
authored andcommitted
fix(ui): make circular usage a full 360 ring
1 parent 5ca6fa8 commit 404b328

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

dashboard/src/components/ui/circular-progress.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ const CircularProgress = React.forwardRef<HTMLDivElement, CircularProgressProps>
3131
const normalizedValue = clamp(value)
3232
const radius = (size - strokeWidth) / 2
3333
const circumference = 2 * Math.PI * radius
34-
const visibleArc = circumference * 0.75
35-
const hiddenArc = circumference - visibleArc
36-
const progressArc = visibleArc * (normalizedValue / 100)
34+
const progressArc = circumference * (normalizedValue / 100)
3735
const valueText = valueFormatter ? valueFormatter(normalizedValue) : `${normalizedValue.toFixed(2)}%`
3836

3937
return (
@@ -47,7 +45,7 @@ const CircularProgress = React.forwardRef<HTMLDivElement, CircularProgressProps>
4745
width={size}
4846
height={size}
4947
viewBox={`0 0 ${size} ${size}`}
50-
className="-rotate-[135deg]"
48+
className="-rotate-90"
5149
role="img"
5250
aria-label={`Progress ${valueText}`}
5351
>
@@ -57,7 +55,7 @@ const CircularProgress = React.forwardRef<HTMLDivElement, CircularProgressProps>
5755
r={radius}
5856
fill="none"
5957
strokeWidth={strokeWidth}
60-
strokeDasharray={`${visibleArc} ${hiddenArc}`}
58+
strokeDasharray={`${circumference} ${circumference}`}
6159
className={cn('stroke-muted/40', trackClassName)}
6260
strokeLinecap="round"
6361
/>

0 commit comments

Comments
 (0)