From 9815117da54de29f5f17aab6f737317389a6ecee Mon Sep 17 00:00:00 2001 From: Nazareno Oviedo Date: Thu, 31 Mar 2022 13:17:25 -0300 Subject: [PATCH] feat: preload fonts, remove GA --- src/components/common/meta.tsx | 11 ++++++++++- src/lib/constants.ts | 2 +- src/pages/_app.tsx | 6 +++--- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/components/common/meta.tsx b/src/components/common/meta.tsx index 814518d..312d957 100644 --- a/src/components/common/meta.tsx +++ b/src/components/common/meta.tsx @@ -21,6 +21,12 @@ export type MetaProps = BasicMeta & { rawNextSeoProps?: NextSeoProps } export const Meta = (props: MetaProps) => { const router = useRouter() + const preloadFonts = [ + { href: '/fonts/arthemys/ArthemysDisplay-Regular.woff2', as: 'font' }, + { href: '/fonts/tt-hoves/TTHoves-Regular.woff2', as: 'font' }, + { href: '/fonts/dm-mono/DMMono-Regular.woff2', as: 'font' } + ] + const nextSeoProps: NextSeoProps = React.useMemo(() => { return { title: props.title ?? defaultMeta.title, @@ -78,6 +84,9 @@ export const Meta = (props: MetaProps) => { + {preloadFonts?.map(({ href, as }) => ( + + ))} {props.preload?.map(({ href, as }) => ( ))} @@ -88,7 +97,7 @@ export const Meta = (props: MetaProps) => { diff --git a/src/lib/constants.ts b/src/lib/constants.ts index acc1847..c867fc2 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -26,7 +26,7 @@ export const basementLog = ` export const defaultMeta = { title: 'Laconic Network', - description: ``, + description: 'Laconic Network Description', ogImage: `${siteOrigin}/og.jpeg`, twitter: { handle: '@laconicnetwork', diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 174ff5f..d1c4c83 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -8,7 +8,7 @@ import * as React from 'react' import { AnimationContextProvider } from '~/context/animation' import { basementLog, isProd } from '~/lib/constants' import { FontsReadyScript } from '~/lib/font-scripts' -import { GAScripts, useAppGA } from '~/lib/ga' +// import { GAScripts, useAppGA } from '~/lib/ga' import { PageTransitionsProvider } from '~/lib/gsap/page-transitions' export type Page

> = NextComponentType< @@ -27,7 +27,7 @@ if (isProd) { } const App = ({ Component, pageProps, ...rest }: AppProps) => { - useAppGA() + // useAppGA() React.useEffect(() => { function handleKeyDown(event: KeyboardEvent) { @@ -56,7 +56,7 @@ const App = ({ Component, pageProps, ...rest }: AppProps) => { - + {/* */} {getLayout({ Component, pageProps, ...rest })}