refactor: strip stats and unit switcher from top bar
Remove weight unit switcher pills and collection stats (items, weight, spent) from TotalsBar. Top bar now shows only logo/title and user menu. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -114,23 +114,8 @@ function RootLayout() {
|
||||
const currentThreadId = threadMatch ? Number(threadMatch.threadId) : null;
|
||||
|
||||
const isDashboard = !!matchRoute({ to: "/" });
|
||||
const isCollection = !!matchRoute({ to: "/collection", fuzzy: true });
|
||||
const isSetupDetail = !!matchRoute({ to: "/setups/$setupId", fuzzy: true });
|
||||
|
||||
// Determine TotalsBar props based on current route
|
||||
const _totalsBarProps = isDashboard
|
||||
? { stats: [] as Array<{ label: string; value: string }> } // Title only, no stats, no link
|
||||
: isSetupDetail
|
||||
? { linkTo: "/" } // Setup detail will render its own local bar; root bar just has link
|
||||
: { linkTo: "/" }; // All other pages: default stats + link to dashboard
|
||||
|
||||
// On dashboard, don't show the default global stats - pass empty stats
|
||||
// On collection, let TotalsBar fetch its own global stats (default behavior)
|
||||
const finalTotalsProps = isDashboard
|
||||
? { stats: [] as Array<{ label: string; value: string }> }
|
||||
: isCollection
|
||||
? { linkTo: "/" }
|
||||
: { linkTo: "/" };
|
||||
const totalsBarProps = isDashboard ? {} : { linkTo: "/" };
|
||||
|
||||
// Show loading while checking auth
|
||||
if (authLoading) {
|
||||
@@ -170,7 +155,7 @@ function RootLayout() {
|
||||
|
||||
return (
|
||||
<div className="min-h-screen bg-gray-50">
|
||||
<TotalsBar {...finalTotalsProps} />
|
||||
<TotalsBar {...totalsBarProps} />
|
||||
<Outlet />
|
||||
|
||||
{/* Item Confirm Delete Dialog */}
|
||||
|
||||
Reference in New Issue
Block a user