diff --git a/apps/web/src/modules/routine/RoutineTimeline.tsx b/apps/web/src/modules/routine/RoutineTimeline.tsx index 4952d0749..9077c4dd8 100644 --- a/apps/web/src/modules/routine/RoutineTimeline.tsx +++ b/apps/web/src/modules/routine/RoutineTimeline.tsx @@ -8,6 +8,10 @@ */ import { Banner } from "@shared/components/ui/Banner"; +import { + DataState, + type DataStateQueryLike, +} from "@shared/components/ui/DataState"; import { PullToRefresh } from "@shared/components/ui/PullToRefresh"; import { SectionErrorBoundary } from "@shared/components/ui/SectionErrorBoundary"; import { SkeletonHabitRow } from "@shared/components/ui/Skeleton"; @@ -46,6 +50,25 @@ export function RoutineTimeline({ onPullRefresh, onPullRefreshError, }: RoutineTimelineProps) { + const calendarBusy = isHabitPending && mainTab === "calendar"; + const calendarQuery: DataStateQueryLike = { + data: calendarBusy ? undefined : (true as const), + isLoading: calendarBusy, + }; + + const calendarLoadingSkeleton = ( +
+ {[0, 1, 2, 3].map((i) => ( + + ))} +
+ ); + return (
- {isHabitPending && mainTab === "calendar" ? ( -
- {[0, 1, 2, 3].map((i) => ( - - ))} -
- ) : ( -