mirror of
https://github.com/lukevella/rallly.git
synced 2025-05-09 07:06:06 +02:00
Enable vercel analytics (#424)
This commit is contained in:
parent
2f7f0f8734
commit
10c55ff2b7
3 changed files with 15 additions and 0 deletions
|
@ -32,6 +32,7 @@
|
||||||
"@trpc/next": "^10.0.0-rc.8",
|
"@trpc/next": "^10.0.0-rc.8",
|
||||||
"@trpc/react-query": "^10.0.0-rc.8",
|
"@trpc/react-query": "^10.0.0-rc.8",
|
||||||
"@trpc/server": "^10.0.0-rc.8",
|
"@trpc/server": "^10.0.0-rc.8",
|
||||||
|
"@vercel/analytics": "^0.1.8",
|
||||||
"accept-language-parser": "^1.5.0",
|
"accept-language-parser": "^1.5.0",
|
||||||
"autoprefixer": "^10.4.2",
|
"autoprefixer": "^10.4.2",
|
||||||
"axios": "^0.24.0",
|
"axios": "^0.24.0",
|
||||||
|
|
|
@ -3,12 +3,14 @@ import "tailwindcss/tailwind.css";
|
||||||
import "~/style.css";
|
import "~/style.css";
|
||||||
|
|
||||||
import { Inter, Noto_Sans_Mono } from "@next/font/google";
|
import { Inter, Noto_Sans_Mono } from "@next/font/google";
|
||||||
|
import { inject } from "@vercel/analytics";
|
||||||
import { NextPage } from "next";
|
import { NextPage } from "next";
|
||||||
import { AppProps } from "next/app";
|
import { AppProps } from "next/app";
|
||||||
import Head from "next/head";
|
import Head from "next/head";
|
||||||
import { appWithTranslation } from "next-i18next";
|
import { appWithTranslation } from "next-i18next";
|
||||||
import PlausibleProvider from "next-plausible";
|
import PlausibleProvider from "next-plausible";
|
||||||
import { DefaultSeo } from "next-seo";
|
import { DefaultSeo } from "next-seo";
|
||||||
|
import React from "react";
|
||||||
import { Toaster } from "react-hot-toast";
|
import { Toaster } from "react-hot-toast";
|
||||||
|
|
||||||
import Maintenance from "@/components/maintenance";
|
import Maintenance from "@/components/maintenance";
|
||||||
|
@ -30,6 +32,13 @@ const noto = Noto_Sans_Mono({
|
||||||
const MyApp: NextPage<AppProps> = ({ Component, pageProps }) => {
|
const MyApp: NextPage<AppProps> = ({ Component, pageProps }) => {
|
||||||
useCrispChat();
|
useCrispChat();
|
||||||
|
|
||||||
|
React.useEffect(() => {
|
||||||
|
if (process.env.NEXT_PUBLIC_ENABLE_ANALYTICS) {
|
||||||
|
// calling inject directly to avoid having this run for self-hosted instances
|
||||||
|
inject();
|
||||||
|
}
|
||||||
|
}, []);
|
||||||
|
|
||||||
if (process.env.NEXT_PUBLIC_MAINTENANCE_MODE === "1") {
|
if (process.env.NEXT_PUBLIC_MAINTENANCE_MODE === "1") {
|
||||||
return <Maintenance />;
|
return <Maintenance />;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2115,6 +2115,11 @@
|
||||||
"@typescript-eslint/types" "5.21.0"
|
"@typescript-eslint/types" "5.21.0"
|
||||||
eslint-visitor-keys "^3.0.0"
|
eslint-visitor-keys "^3.0.0"
|
||||||
|
|
||||||
|
"@vercel/analytics@^0.1.8":
|
||||||
|
version "0.1.8"
|
||||||
|
resolved "https://registry.yarnpkg.com/@vercel/analytics/-/analytics-0.1.8.tgz#71f1f8c7bb98ac0c5c47eb3fb8ccbe8141b9fe47"
|
||||||
|
integrity sha512-PQrOI8BJ9qUiVJuQfnKiJd15eDjDJH9TBKsNeMrtelT4NAk7d9mBVz1CoZkvoFnHQ0OW7Xnqmr1F2nScfAnznQ==
|
||||||
|
|
||||||
"@xobotyi/scrollbar-width@^1.9.5":
|
"@xobotyi/scrollbar-width@^1.9.5":
|
||||||
version "1.9.5"
|
version "1.9.5"
|
||||||
resolved "https://registry.npmjs.org/@xobotyi/scrollbar-width/-/scrollbar-width-1.9.5.tgz"
|
resolved "https://registry.npmjs.org/@xobotyi/scrollbar-width/-/scrollbar-width-1.9.5.tgz"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue