feat: update layout to conditionally render header based on current route in RootComponent

This commit is contained in:
2025-09-04 11:53:28 -03:00
parent 7dfa57bc68
commit 3972771148

View File

@@ -46,6 +46,12 @@ function RootComponent() {
select: (s) => s.isLoading,
});
const currentPath = useRouterState({
select: (s) => s.location.pathname,
});
const isSpaceRoute = currentPath === "/space";
return (
<>
<HeadContent />
@@ -58,8 +64,10 @@ function RootComponent() {
forcedTheme="dark"
storageKey="vite-ui-theme"
>
<div className="grid min-h-svh grid-rows-[auto_1fr_auto]">
<Header />
<div
className={`grid min-h-svh ${isSpaceRoute ? "grid-rows-[1fr_auto]" : "grid-rows-[auto_1fr_auto]"}`}
>
{!isSpaceRoute && <Header />}
{isFetching ? <Loader /> : <Outlet />}
<Footer />
</div>