Skip to content

Commit

Permalink
🐛 Fix vercel speed insight (#814)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xlny authored Oct 16, 2024
1 parent 13ec855 commit a87430d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ import "../styles/globals.css";
import "@fortawesome/fontawesome-svg-core/styles.css";
import { ChakraProvider } from "@chakra-ui/react";
import { Analytics } from "@vercel/analytics/react";
import { SpeedInsights } from "@vercel/speed-insights/react";
import dayjs from "dayjs";
import duration from "dayjs/plugin/duration";
import type { AppProps } from "next/app";
import { useRouter } from "next/router";
import { NextSeo } from "next-seo";

import defaultSEOConfig from "../../next-seo.config";
Expand All @@ -15,13 +17,15 @@ import customTheme from "../styles/customTheme";
dayjs.extend(duration);

function StarknetEcosystem({ Component, pageProps }: AppProps) {
const router = useRouter();
return (
<TranslateProvider>
<ChakraProvider theme={customTheme}>
<NextSeo {...defaultSEOConfig} />
<Layout>
<Component {...pageProps} />
<Analytics />
<SpeedInsights sampleRate={70} route={router.pathname} />
</Layout>
</ChakraProvider>
</TranslateProvider>
Expand Down
2 changes: 0 additions & 2 deletions src/pages/_document.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* eslint-disable react/jsx-props-no-spreading */
import { ColorModeScript } from "@chakra-ui/color-mode";
import createEmotionServer from "@emotion/server/create-instance";
import { SpeedInsights } from "@vercel/speed-insights/next";
import type { DocumentContext } from "next/document";
import Document, { Html, Head, Main, NextScript } from "next/document";
import * as React from "react";
Expand Down Expand Up @@ -115,7 +114,6 @@ class MyDocument extends Document {
<ColorModeScript initialColorMode="dark" />
<Main />
<NextScript />
<SpeedInsights sampleRate={70} />
</body>
</Html>
);
Expand Down

0 comments on commit a87430d

Please sign in to comment.