- WelcomeBanner.tsx: guest-only dismissible onboarding card on dashboard (localStorage pv_seen_welcome, Browse Bills CTA, X dismiss) - useDashboard: add !!token to query key so login/logout triggers a fresh fetch without manual refresh - ARCHITECTURE.md: WelcomeBanner component, auth-aware query keys, v0.6.1 feature history entry - Roadmap: mark welcome banner items complete - Add MVP planning notes (Phase 3-6 roadmap draft) Co-Authored-By: Jack Levy
14 lines
391 B
TypeScript
14 lines
391 B
TypeScript
import { useQuery } from "@tanstack/react-query";
|
|
import { dashboardAPI } from "../api";
|
|
import { useAuthStore } from "@/stores/authStore";
|
|
|
|
export function useDashboard() {
|
|
const token = useAuthStore((s) => s.token);
|
|
return useQuery({
|
|
queryKey: ["dashboard", !!token],
|
|
queryFn: () => dashboardAPI.get(),
|
|
staleTime: 2 * 60 * 1000,
|
|
refetchInterval: 5 * 60 * 1000,
|
|
});
|
|
}
|