diff --git a/apps/app/src/pages/_app.tsx b/apps/app/src/pages/_app.tsx
index 774dc2a6193..b66767f3792 100644
--- a/apps/app/src/pages/_app.tsx
+++ b/apps/app/src/pages/_app.tsx
@@ -9,8 +9,9 @@ import { type AppProps, type NextWebVitalsMetric } from 'next/app'
import dynamic from 'next/dynamic'
import Head from 'next/head'
import { useRouter } from 'next/router'
+import Script from 'next/script'
import { type Session } from 'next-auth'
-import { appWithTranslation, type UserConfig } from 'next-i18next'
+import { appWithTranslation } from 'next-i18next'
import { DefaultSeo, type DefaultSeoProps } from 'next-seo'
import { GoogleAnalytics } from 'nextjs-google-analytics'
@@ -51,27 +52,24 @@ export function reportWebVitals(stats: NextWebVitalsMetric) {
appEvent.webVitals(stats)
}
+const PageContent = ({ Component, ...pageProps }: AppPropsWithGridSwitch) => {
+ const router = useRouter()
+ const autoResetState = Component.autoResetState ? { key: router.asPath } : {}
+ return Component.omitGrid ? (
+
+ ) : (
+
+
+
+ )
+}
+
const MyApp = (appProps: AppPropsWithGridSwitch) => {
const {
- Component,
- pageProps: { session, ...pageProps },
+ pageProps: { session },
} = appProps
-
- const router = useRouter()
-
const { isMobile, isTablet } = useScreenSize()
- const autoResetState = Component.autoResetState ? { key: router.asPath } : {}
-
- const PageContent = () =>
- Component.omitGrid ? (
-
- ) : (
-
-
-
- )
-
return (
<>
@@ -80,9 +78,14 @@ const MyApp = (appProps: AppPropsWithGridSwitch) => {
+
-
+
{(isMobile || isTablet) && }
diff --git a/apps/app/src/pages/_document.tsx b/apps/app/src/pages/_document.tsx
index 4599ad5527e..d2ced74d90f 100644
--- a/apps/app/src/pages/_document.tsx
+++ b/apps/app/src/pages/_document.tsx
@@ -1,5 +1,5 @@
import { createStylesServer, ServerStyles } from '@mantine/next'
-import Document, { type DocumentContext, Head, Html, Main, NextScript } from 'next/document'
+import NextDocument, { type DocumentContext, Head, Html, Main, NextScript } from 'next/document'
import Script from 'next/script'
import { appCache } from '@weareinreach/ui/theme'
@@ -7,9 +7,9 @@ import { appCache } from '@weareinreach/ui/theme'
import i18nextConfig from '../../next-i18next.config.mjs'
const stylesServer = createStylesServer(appCache)
-export default class _Document extends Document {
+export default class Document extends NextDocument {
static async getInitialProps(ctx: DocumentContext) {
- const initialProps = await Document.getInitialProps(ctx)
+ const initialProps = await NextDocument.getInitialProps(ctx)
return {
...initialProps,
styles: [
@@ -20,7 +20,7 @@ export default class _Document extends Document {
}
render() {
- const currentLocale = this.props.__NEXT_DATA__.locale || i18nextConfig.i18n.defaultLocale
+ const currentLocale = this.props.__NEXT_DATA__.locale ?? i18nextConfig.i18n.defaultLocale
return (