* [examples/ckan][m]: rplc @flowershow with @portaljs packages * [examples/fivethirtyeight][m]: rplc @flowershow with @portaljs packages * [examples/turing][m]: rplc @flowershow with @portaljs packages * [examples/openspending][m]: rplc @flowershow with @portaljs packages * [examples/learn][m]: rplc @flowershow with @portaljs packages * [examples/github-backed-catalog][m]: rplc @flowershow with @portaljs packages * [examples/github-backed-catalog][xs] - fix build * [examples][m] - fix builds * [examples/openspending][xs] - fix build --------- Co-authored-by: Luccas Mateus de Medeiros Gomes <luccasmmg@gmail.com>
50 lines
1.3 KiB
TypeScript
50 lines
1.3 KiB
TypeScript
import '@/styles/globals.css';
|
|
import '@portaljs/components/styles.css';
|
|
import { useEffect } from 'react';
|
|
import { pageview } from '@portaljs/core';
|
|
import Script from 'next/script';
|
|
import Head from 'next/head';
|
|
import { useRouter } from 'next/router';
|
|
|
|
import type { AppProps } from 'next/app';
|
|
|
|
export default function App({ Component, pageProps }: AppProps) {
|
|
const router = useRouter();
|
|
|
|
useEffect(() => {
|
|
const handleRouteChange = (url: any) => {
|
|
pageview(url);
|
|
};
|
|
router.events.on('routeChangeComplete', handleRouteChange);
|
|
return () => {
|
|
router.events.off('routeChangeComplete', handleRouteChange);
|
|
};
|
|
}, [router.events]);
|
|
return (
|
|
<>
|
|
<Head>
|
|
<link rel="shortcut icon" href="/squared_logo.png" />
|
|
</Head>
|
|
<Script
|
|
strategy="afterInteractive"
|
|
src="https://www.googletagmanager.com/gtag/js?id=G-3N9SXTC7GS"
|
|
/>
|
|
<Script
|
|
id="gtag-init"
|
|
strategy="afterInteractive"
|
|
dangerouslySetInnerHTML={{
|
|
__html: `
|
|
window.dataLayer = window.dataLayer || [];
|
|
function gtag(){dataLayer.push(arguments);}
|
|
gtag('js', new Date());
|
|
gtag('config', 'G-3N9SXTC7GS', {
|
|
page_path: window.location.pathname,
|
|
});
|
|
`,
|
|
}}
|
|
/>
|
|
<Component {...pageProps} />
|
|
</>
|
|
);
|
|
}
|