kopia lustrzana https://github.com/bugout-dev/moonstream
logo preconnect on all routes
rodzic
29080cbf30
commit
99a486f91f
|
@ -21,6 +21,7 @@ const DefaultLayout = dynamic(() => import("../src/layouts"), {
|
||||||
});
|
});
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import NProgress from "nprogress";
|
import NProgress from "nprogress";
|
||||||
|
import { WHITE_LOGO_W_TEXT_URL } from "../src/core/constants";
|
||||||
|
|
||||||
export default function CachingApp({ Component, pageProps }) {
|
export default function CachingApp({ Component, pageProps }) {
|
||||||
const [queryClient] = useState(new QueryClient());
|
const [queryClient] = useState(new QueryClient());
|
||||||
|
@ -48,6 +49,11 @@ export default function CachingApp({ Component, pageProps }) {
|
||||||
const getLayout =
|
const getLayout =
|
||||||
Component.getLayout || ((page) => <DefaultLayout>{page}</DefaultLayout>);
|
Component.getLayout || ((page) => <DefaultLayout>{page}</DefaultLayout>);
|
||||||
|
|
||||||
|
const headLinks = [
|
||||||
|
{ rel: "preload", as: "image", href: WHITE_LOGO_W_TEXT_URL },
|
||||||
|
];
|
||||||
|
pageProps.preloads && headLinks.push(...pageProps.preloads);
|
||||||
|
console.log(headLinks);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<style global jsx>{`
|
<style global jsx>{`
|
||||||
|
@ -62,7 +68,7 @@ export default function CachingApp({ Component, pageProps }) {
|
||||||
}
|
}
|
||||||
`}</style>
|
`}</style>
|
||||||
{pageProps.metaTags && <HeadSEO {...pageProps.metaTags} />}
|
{pageProps.metaTags && <HeadSEO {...pageProps.metaTags} />}
|
||||||
{pageProps.preloads && <HeadLinks links={pageProps.preloads} />}
|
<HeadLinks links={headLinks} />
|
||||||
<QueryClientProvider client={queryClient}>
|
<QueryClientProvider client={queryClient}>
|
||||||
<AppContext>{getLayout(<Component {...pageProps} />)}</AppContext>
|
<AppContext>{getLayout(<Component {...pageProps} />)}</AppContext>
|
||||||
</QueryClientProvider>
|
</QueryClientProvider>
|
||||||
|
|
Ładowanie…
Reference in New Issue