2026-07-05 17:18:31 -05:00
|
|
|
import React from 'react';
|
2026-05-09 13:03:36 -05:00
|
|
|
import { NavLink } from 'react-router-dom';
|
2026-07-05 17:18:31 -05:00
|
|
|
import { BrandMark, BrandWordmark } from '@/components/brand/Brand';
|
|
|
|
|
import { BRAND } from '@/lib/brand';
|
2026-05-09 13:03:36 -05:00
|
|
|
|
refactor(ts): convert the app shell to TSX (B7)
App.tsx (routing + QueryClient), main.tsx (entry; index.html updated to
main.tsx), useAuth.tsx (typed AuthContextValue/User + MeResponse; uses the safe
useContext()||defaults pattern so no `never` trap), and the layout components
(Layout, Sidebar, NavPill, BrandBlock — NavItem type, LucideIcon-typed nav
config, casts for the untyped overdue/simplefin API responses). TS caught a dead
prop: App passed mainContentId to TrackerPage, which takes no params — removed.
typecheck 0, lint 0 errors (39 warns), build green, 17/17 e2e probe.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-04 19:49:57 -05:00
|
|
|
export const BrandBlock = React.memo(function BrandBlock({ adminMode = false }: { adminMode?: boolean }) {
|
2026-05-09 13:03:36 -05:00
|
|
|
return (
|
|
|
|
|
<NavLink
|
|
|
|
|
to={adminMode ? '/admin' : '/'}
|
2026-07-05 17:18:31 -05:00
|
|
|
aria-label={BRAND.name}
|
|
|
|
|
className="group flex items-center gap-2 rounded-xl focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50"
|
2026-05-09 13:03:36 -05:00
|
|
|
>
|
2026-07-05 17:18:31 -05:00
|
|
|
<BrandMark className="h-12 w-auto max-w-[6.75rem] drop-shadow-[0_1px_2px_rgba(0,0,0,0.24)] transition-transform duration-200 group-hover:scale-[1.015]" />
|
|
|
|
|
<BrandWordmark className="sr-only" />
|
2026-05-09 13:03:36 -05:00
|
|
|
{adminMode && (
|
|
|
|
|
<span className="hidden sm:inline-flex rounded-full border border-destructive/25 bg-destructive/10 px-2 py-0.5 text-[10px] font-semibold uppercase text-destructive">
|
|
|
|
|
Admin
|
|
|
|
|
</span>
|
|
|
|
|
)}
|
|
|
|
|
</NavLink>
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
BrandBlock.displayName = 'BrandBlock';
|