From 3e944914744c3696d650295beac18a8703d0a846 Mon Sep 17 00:00:00 2001 From: Doug Andrade Date: Tue, 30 May 2023 02:17:34 -0400 Subject: [PATCH] fixed next/font load on ALL pages and toast. --- apps/web/components/layout.tsx | 17 +---------------- apps/web/pages/_app.tsx | 21 +++++++++++++++++++-- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/apps/web/components/layout.tsx b/apps/web/components/layout.tsx index d9e8922e2..aa0fad8dc 100644 --- a/apps/web/components/layout.tsx +++ b/apps/web/components/layout.tsx @@ -1,5 +1,4 @@ import { useEffect } from "react"; -import { Montserrat, Qwigley } from "next/font/google"; import Link from "next/link"; import { useRouter } from "next/router"; import { NEXT_PUBLIC_WEBAPP_URL } from "@documenso/lib/constants"; @@ -10,20 +9,6 @@ import { PaperAirplaneIcon } from "@heroicons/react/24/outline"; import { SubscriptionStatus } from "@prisma/client"; import { useSession } from "next-auth/react"; -const montserrat = Montserrat({ - subsets: ["latin"], - weight: ["400", "700"], - display: "swap", - variable: "--font-sans", -}); - -const qwigley = Qwigley({ - subsets: ["latin"], - weight: ["400"], - display: "swap", - variable: "--font-qwigley", -}); - function useRedirectToLoginIfUnauthenticated() { const { data: session, status } = useSession(); const loading = status === "loading"; @@ -54,7 +39,7 @@ export default function Layout({ children }: any) { return ( <> -
+
diff --git a/apps/web/pages/_app.tsx b/apps/web/pages/_app.tsx index cd5541cbb..866b742c3 100644 --- a/apps/web/pages/_app.tsx +++ b/apps/web/pages/_app.tsx @@ -1,6 +1,7 @@ import { ReactElement, ReactNode } from "react"; import { NextPage } from "next"; import type { AppProps } from "next/app"; +import { Montserrat, Qwigley } from "next/font/google"; import { SubscriptionProvider } from "@documenso/lib/stripe/providers/subscription-provider"; import "../../../node_modules/placeholder-loading/src/scss/placeholder-loading.scss"; import "../../../node_modules/react-resizable/css/styles.css"; @@ -11,6 +12,20 @@ import "react-tooltip/dist/react-tooltip.css"; export { coloredConsole } from "@documenso/lib"; +const montserrat = Montserrat({ + subsets: ["latin"], + weight: ["400", "700"], + display: "swap", + variable: "--font-sans", +}); + +const qwigley = Qwigley({ + subsets: ["latin"], + weight: ["400"], + display: "swap", + variable: "--font-qwigley", +}); + export type NextPageWithLayout

= NextPage & { getLayout?: (page: ReactElement) => ReactNode; }; @@ -27,8 +42,10 @@ export default function App({ return ( - - {getLayout()} +

+ + {getLayout()} +
);