Skip to content

Commit 48fce0f

Browse files
authored
feat: add a cursor to the sales status chart for better user visual tracking (#385)
* refactor: move the chart config outside of the react component * feat: add a cursor to the chart tooltip for better visual tracking
1 parent a9d22d6 commit 48fce0f

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

src/routes/_auth/(dashboard)/-components/widget-grid/widgets/sales-status.tsx

+11-12
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,20 @@ import { useWidgetName } from "@/routes/_auth/(dashboard)/-components/useWidgetN
1818

1919
import { WidgetSkeleton, type CommonWidgetProps } from "./_common";
2020

21+
const chartConfig = {
22+
previousTotal: {
23+
label: "Last year",
24+
color: "hsl(var(--chart-1))",
25+
},
26+
total: {
27+
label: "This year",
28+
color: "hsl(var(--chart-2))",
29+
},
30+
} satisfies ChartConfig;
31+
2132
export default function SalesStatusWidget(props: CommonWidgetProps) {
2233
const { auth, selectedLocationIds, widgetId } = props;
2334

24-
const chartConfig = {
25-
previousTotal: {
26-
label: "Last year",
27-
color: "hsl(var(--chart-1))",
28-
},
29-
total: {
30-
label: "This year",
31-
color: "hsl(var(--chart-2))",
32-
},
33-
} satisfies ChartConfig;
34-
3535
const widgetName = useWidgetName(widgetId);
3636

3737
const { t } = useTranslation();
@@ -81,7 +81,6 @@ export default function SalesStatusWidget(props: CommonWidgetProps) {
8181
tickMargin={8}
8282
/>
8383
<ChartTooltip
84-
cursor={false}
8584
content={<ChartTooltipContent indicator="dot" />}
8685
formatter={(value) =>
8786
t("intlCurrency", {

0 commit comments

Comments
 (0)