From 0ce10269c2eb5b89cdee13e493bc9e2e0b430be9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D5=A1=D3=84=D5=A1?= Date: Tue, 27 Feb 2024 22:31:38 +0800 Subject: [PATCH] fix(components): incorrect strokeWidth (#2410) * fix(components): incorrect strokeWidth * feat(changeset): incorrect strokeWidth in circular progress --- .changeset/tricky-moons-obey.md | 5 +++++ packages/components/progress/src/use-circular-progress.ts | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/tricky-moons-obey.md diff --git a/.changeset/tricky-moons-obey.md b/.changeset/tricky-moons-obey.md new file mode 100644 index 0000000000..68a18a818e --- /dev/null +++ b/.changeset/tricky-moons-obey.md @@ -0,0 +1,5 @@ +--- +"@nextui-org/progress": patch +--- + +fix incorrect strokeWidth in circular progress (#1790) diff --git a/packages/components/progress/src/use-circular-progress.ts b/packages/components/progress/src/use-circular-progress.ts index 6d8adf6a36..e8d8131af0 100644 --- a/packages/components/progress/src/use-circular-progress.ts +++ b/packages/components/progress/src/use-circular-progress.ts @@ -112,7 +112,8 @@ export function useCircularProgress(originalProps: UseCircularProgressProps) { const selfMounted = originalProps.disableAnimation ? true : isMounted; const center = 16; - const strokeWidth = strokeWidthProp || originalProps.size === "sm" ? 2 : 3; + const strokeWidth = strokeWidthProp || (originalProps.size === "sm" ? 2 : 3); + const radius = 16 - strokeWidth; const circumference = 2 * radius * Math.PI;