@@ -4,14 +4,26 @@ import { useRouter } from 'next/router';
44import Head from 'next/head' ;
55import { appWithTranslation } from 'next-i18next' ;
66import { ThemeProvider } from 'next-themes' ;
7+ import PlausibleProvider from 'next-plausible' ;
78import nextI18NextConfig from '../../next-i18next.config' ;
89import { WalletProvider } from '../context/WalletContext' ;
910import { ErrorBoundary } from '../components/ErrorBoundary' ;
1011import { GlobalShell } from '../components/PWA/GlobalShell' ;
11- import PWAInstallPrompt from '../components/PWAInstallPrompt ' ;
12+ import { CookieConsentBanner } from '../components/CookieConsentBanner ' ;
1213import { Toaster } from 'react-hot-toast' ;
1314import '../styles/globals.css' ;
1415
16+ export function reportWebVitals ( metric : any ) {
17+ if ( typeof window !== 'undefined' && ( window as any ) . plausible ) {
18+ ( window as any ) . plausible ( 'Web Vitals' , {
19+ props : {
20+ metric : metric . name ,
21+ value : Math . round ( metric . name === 'CLS' ? metric . value * 1000 : metric . value ) ,
22+ } ,
23+ } ) ;
24+ }
25+ }
26+
1527function MyApp ( { Component, pageProps } : AppProps ) {
1628 const router = useRouter ( ) ;
1729 const hasMounted = useRef ( false ) ;
@@ -37,13 +49,7 @@ function MyApp({ Component, pageProps }: AppProps) {
3749 } , [ router . asPath ] ) ;
3850
3951 return (
40- < >
41- < Head >
42- < meta name = "viewport" content = "width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
43- < link rel = "manifest" href = "/manifest.json" />
44- < meta name = "theme-color" content = "#3b82f6" />
45- < link rel = "apple-touch-icon" href = "/icons/icon-192x192.png" />
46- </ Head >
52+ < PlausibleProvider domain = "starked-education.com" trackLocalhost = { true } >
4753 < ThemeProvider attribute = "class" defaultTheme = "system" enableSystem storageKey = "starked-theme" >
4854 < ErrorBoundary key = { router . asPath } >
4955 < WalletProvider >
@@ -60,7 +66,7 @@ function MyApp({ Component, pageProps }: AppProps) {
6066 </ div >
6167 < GlobalShell />
6268 < Component { ...pageProps } />
63- < PWAInstallPrompt />
69+ < CookieConsentBanner />
6470 < Toaster
6571 position = "bottom-right"
6672 toastOptions = { {
@@ -70,7 +76,7 @@ function MyApp({ Component, pageProps }: AppProps) {
7076 </ WalletProvider >
7177 </ ErrorBoundary >
7278 </ ThemeProvider >
73- </ >
79+ </ PlausibleProvider >
7480 ) ;
7581}
7682
0 commit comments