Add check for if we should show default metadata

This commit is contained in:
Lee 2022-11-19 10:45:46 +00:00
parent 67de6dc57b
commit 0cd7e1e3df
No known key found for this signature in database
GPG Key ID: 6EA25896ECCB3121

@ -3,16 +3,21 @@ import "../styles/globals.css";
import { NextUIProvider } from "@nextui-org/react";
import { SessionProvider } from "next-auth/react";
import { NextSeo } from "next-seo";
import { useRouter } from "next/router";
import Layout from "src/components/Layout";
import { baseOpenGraph } from "src/consts/openGraphBase";
import { darkTheme } from "src/consts/themes";
function MyApp({ Component, pageProps: { session, ...pageProps } }) {
const router = useRouter();
const shouldReturnMetadata = router.pathname !== "/files/[fileId]";
return (
<NextUIProvider theme={darkTheme}>
<NextSeo
titleTemplate="%s | Imageify"
themeColor="#0063EB"
//openGraph={baseOpenGraph}
openGraph={shouldReturnMetadata ? baseOpenGraph : undefined}
/>
<Layout>
<SessionProvider session={session}>