From 65aaa54a70faee26565e60a06f5094256a1e7db4 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Sat, 18 Jun 2022 15:53:53 +0300 Subject: [PATCH] Remove unused pageTitle --- app/components/layout/index.tsx | 18 ------------------ app/styles/layout.css | 7 ------- 2 files changed, 25 deletions(-) diff --git a/app/components/layout/index.tsx b/app/components/layout/index.tsx index d5cf55d09..71277a9f6 100644 --- a/app/components/layout/index.tsx +++ b/app/components/layout/index.tsx @@ -1,4 +1,3 @@ -import { useMatches } from "@remix-run/react"; import * as React from "react"; import { useWindowSize } from "~/hooks/useWindowSize"; import { HamburgerButton } from "./HamburgerButton"; @@ -12,27 +11,10 @@ export const Layout = React.memo(function Layout({ children: React.ReactNode; }) { const [menuOpen, setMenuOpen] = React.useState(false); - const matches = useMatches(); - - const pageTitleKey = "pageTitle"; - - // you can set this page title from any loader - // deeper routes take precedence - const pageTitle = matches - .map((match) => match.data) - .filter(Boolean) - .reduceRight((acc: string | null, routeData) => { - if (!acc && typeof routeData[pageTitleKey] === "string") { - return routeData[pageTitleKey]; - } - - return acc; - }, null); return ( <>
-
{pageTitle}