Skip to content

Commit

Permalink
feat(frontend): display summary section
Browse files Browse the repository at this point in the history
  • Loading branch information
IgnisDa committed Jan 8, 2025
1 parent c5e3d8a commit e2dce95
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion apps/frontend/app/routes/_dashboard.analytics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ import { type ComponentType, type ReactNode, useRef, useState } from "react";
import { ClientOnly } from "remix-utils/client-only";
import { match } from "ts-pattern";
import { useLocalStorage } from "usehooks-ts";
import { ProRequiredAlert } from "~/components/common";
import { DisplaySummarySection, ProRequiredAlert } from "~/components/common";
import {
displayDistanceWithUnit,
displayWeightWithUnit,
Expand Down Expand Up @@ -178,7 +178,9 @@ export default function Page() {
const toCaptureRef = useRef<HTMLDivElement>(null);
const { timeSpanSettings, setTimeSpanSettings, startDate, endDate } =
useTimeSpanSettings();
const userAnalytics = useGetUserAnalytics();
const [isCaptureLoading, setIsCaptureLoading] = useAtom(isCaptureLoadingAtom);
const latestUserSummary = userAnalytics?.activities.items.at(0);

return (
<>
Expand Down Expand Up @@ -262,6 +264,13 @@ export default function Page() {
<Grid.Col span={{ base: 12, md: 6 }}>
<TimeOfDayChart />
</Grid.Col>
{latestUserSummary ? (
<Grid.Col span={12}>
<DisplaySummarySection
latestUserSummary={latestUserSummary}
/>
</Grid.Col>
) : null}
<Grid.Col span={12}>
<ActivitySection />
</Grid.Col>
Expand Down

0 comments on commit e2dce95

Please sign in to comment.