Add check for if we should show default metadata
This commit is contained in:
parent
67de6dc57b
commit
0cd7e1e3df
@ -3,16 +3,21 @@ import "../styles/globals.css";
|
|||||||
import { NextUIProvider } from "@nextui-org/react";
|
import { NextUIProvider } from "@nextui-org/react";
|
||||||
import { SessionProvider } from "next-auth/react";
|
import { SessionProvider } from "next-auth/react";
|
||||||
import { NextSeo } from "next-seo";
|
import { NextSeo } from "next-seo";
|
||||||
|
import { useRouter } from "next/router";
|
||||||
import Layout from "src/components/Layout";
|
import Layout from "src/components/Layout";
|
||||||
|
import { baseOpenGraph } from "src/consts/openGraphBase";
|
||||||
import { darkTheme } from "src/consts/themes";
|
import { darkTheme } from "src/consts/themes";
|
||||||
|
|
||||||
function MyApp({ Component, pageProps: { session, ...pageProps } }) {
|
function MyApp({ Component, pageProps: { session, ...pageProps } }) {
|
||||||
|
const router = useRouter();
|
||||||
|
const shouldReturnMetadata = router.pathname !== "/files/[fileId]";
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<NextUIProvider theme={darkTheme}>
|
<NextUIProvider theme={darkTheme}>
|
||||||
<NextSeo
|
<NextSeo
|
||||||
titleTemplate="%s | Imageify"
|
titleTemplate="%s | Imageify"
|
||||||
themeColor="#0063EB"
|
themeColor="#0063EB"
|
||||||
//openGraph={baseOpenGraph}
|
openGraph={shouldReturnMetadata ? baseOpenGraph : undefined}
|
||||||
/>
|
/>
|
||||||
<Layout>
|
<Layout>
|
||||||
<SessionProvider session={session}>
|
<SessionProvider session={session}>
|
||||||
|
Reference in New Issue
Block a user