Switch to hook for crisp chat (#418)

This commit is contained in:
Luke Vella 2023-01-20 15:37:43 +00:00 committed by GitHub
parent 9deb45bd33
commit 8c16966907
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 11 deletions

View file

@ -4,7 +4,6 @@ import "~/style.css";
import { NextPage } from "next";
import { AppProps } from "next/app";
import dynamic from "next/dynamic";
import Head from "next/head";
import { appWithTranslation } from "next-i18next";
import PlausibleProvider from "next-plausible";
@ -13,14 +12,13 @@ import { Toaster } from "react-hot-toast";
import Maintenance from "@/components/maintenance";
import { useCrispChat } from "../components/crisp-chat";
import { absoluteUrl } from "../utils/absolute-url";
import { trpcNext } from "../utils/trpc";
const CrispChat = dynamic(() => import("@/components/crisp-chat"), {
ssr: false,
});
const MyApp: NextPage<AppProps> = ({ Component, pageProps }) => {
useCrispChat();
if (process.env.NEXT_PUBLIC_MAINTENANCE_MODE === "1") {
return <Maintenance />;
}
@ -57,7 +55,6 @@ const MyApp: NextPage<AppProps> = ({ Component, pageProps }) => {
content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no"
/>
</Head>
<CrispChat />
<Toaster />
<Component {...pageProps} />
</PlausibleProvider>