Skip to content

Commit c656fda

Browse files
committed
fix(Chart.Bars): Use theme radius for border radius
1 parent f4797bb commit c656fda

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/components/ui/chart/bars.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { Fragment } from "react/jsx-runtime"
22

3+
import { themeData } from "data/theme"
4+
import { useAtomValue } from "lib/yaasl"
35
import { cn } from "utils/cn"
46

57
import {
@@ -53,6 +55,7 @@ export const Bars = ({
5355
fillColor = "default",
5456
printValue,
5557
}: BarsProps) => {
58+
const { radius } = useAtomValue(themeData)
5659
const { scalePoint, scaleY } = useChartContext()
5760
const bars = points.map(point => {
5861
const top = scalePoint(point)
@@ -70,8 +73,8 @@ export const Bars = ({
7073
ref={node => {
7174
runBarTransition({ node, items: bars.length, index })
7275
}}
73-
rx={2}
74-
ry={2}
76+
rx={radius / 3}
77+
ry={radius / 3}
7578
x={top.x - barWidth / 2}
7679
y={top.y}
7780
width={barWidth}

0 commit comments

Comments
 (0)