Skip to content

Commit

Permalink
feat: slice chart data
Browse files Browse the repository at this point in the history
  • Loading branch information
lance10030 committed Sep 13, 2024
1 parent f58be0b commit 2e26b88
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default function Page() {
error: BoundError,
} = useBoundProgress();
const { data: amountData, error: amountError } = useAmountPerDay();
const days = amountData?.data?.map((item) => item.date);
const days = amountData?.data?.slice(0, -1).map((item) => item.date);

const error =
latestGamesError ||
Expand Down Expand Up @@ -95,7 +95,7 @@ export default function Page() {
<div className="col-span-2 sm:col-span-4">
<DailyAmountChart
days={days}
data={amountData?.data?.map((item) => item.amount)}
data={amountData?.data?.slice(0, -1).map((item) => item.amount)}
compact
/>
</div>
Expand Down Expand Up @@ -144,8 +144,8 @@ export default function Page() {

<div className="col-span-2 sm:col-span-4">
<InprogressChart
days={boundData?.data?.map((item) => item.date)}
data={boundData?.data?.map((item) => item.amount)}
days={boundData?.data?.slice(0, -1).map((item) => item.date)}
data={boundData?.data?.slice(0, -1).map((item) => item.amount)}
compact={false}
/>
</div>
Expand Down

0 comments on commit 2e26b88

Please sign in to comment.