diff --git a/src/client/components/TotalsBar.tsx b/src/client/components/TotalsBar.tsx index b6fa5a9..b023a2c 100644 --- a/src/client/components/TotalsBar.tsx +++ b/src/client/components/TotalsBar.tsx @@ -1,4 +1,5 @@ import { Link } from "@tanstack/react-router"; +import { useAuth, useLogout } from "../hooks/useAuth"; import { useUpdateSetting } from "../hooks/useSettings"; import { useTotals } from "../hooks/useTotals"; import { useWeightUnit } from "../hooks/useWeightUnit"; @@ -19,6 +20,9 @@ export function TotalsBar({ linkTo, }: TotalsBarProps) { const { data } = useTotals(); + const { data: auth } = useAuth(); + const logout = useLogout(); + const isAuthenticated = !!auth?.user; const unit = useWeightUnit(); const updateSetting = useUpdateSetting(); @@ -100,6 +104,24 @@ export function TotalsBar({ ))} )} +
+ {isAuthenticated ? ( + + ) : ( + + Sign in + + )} +
diff --git a/src/client/routes/__root.tsx b/src/client/routes/__root.tsx index 97c0c3d..5363e52 100644 --- a/src/client/routes/__root.tsx +++ b/src/client/routes/__root.tsx @@ -13,6 +13,7 @@ import { ItemForm } from "../components/ItemForm"; import { OnboardingWizard } from "../components/OnboardingWizard"; import { SlideOutPanel } from "../components/SlideOutPanel"; import { TotalsBar } from "../components/TotalsBar"; +import { useAuth } from "../hooks/useAuth"; import { useDeleteCandidate } from "../hooks/useCandidates"; import { useOnboardingComplete } from "../hooks/useSettings"; import { useResolveThread, useThread } from "../hooks/useThreads"; @@ -24,6 +25,8 @@ export const Route = createRootRoute({ function RootLayout() { const navigate = useNavigate(); + const { data: auth } = useAuth(); + const isAuthenticated = !!auth?.user; // Item panel state const panelMode = useUIStore((s) => s.panelMode); @@ -175,7 +178,7 @@ function RootLayout() { )} {/* Floating Add Button - only on collection gear tab */} - {showFab && ( + {showFab && isAuthenticated && (