client/apps/web/src/routes/app/useShowMobileNavbar.ts
Alois be56080ba1
Some checks failed
/ build-desktop (linux) (push) Failing after 52s
/ build-web (push) Failing after 1m3s
/ build-mobile (push) Failing after 1m6s
/ release (push) Has been skipped
(fix): remove unused dependencies
(fix): remove dead code
(fix): remove unused exports
2026-06-03 14:53:18 +02:00

14 lines
453 B
TypeScript

import { useLocation, useMatches } from "@tanstack/react-router";
export function useShowMobileNavbar(): boolean {
const matches = useMatches();
const location = useLocation();
return matches.some(
(match) =>
match.pathname === location.pathname &&
// Router staticData is app-defined and not typed by the route matcher here.
// @ts-expect-error App route metadata
match.staticData?.showMobileNavbar === true,
);
}