mocksaml/pages/_app.tsx
Kiran K fdaa190df4
Add Github actions (#15)
* Add Github actions

* Fix the docker build issue

* Remove the duplicate Github action

* only need runtime env vars during build

* ENV NEXT_TELEMETRY_DISABLED is a runtime env var

* Add missing keys to package.json

* Use the npm version as tag

Co-authored-by: Deepak Prabhakara <deepak@boxyhq.com>
2022-03-10 17:20:33 +00:00

22 lines
542 B
TypeScript

import Layout from 'components/Layout';
import type { AppProps } from 'next/app';
import { useEffect } from 'react';
import TagManager from 'react-gtm-module';
import 'styles/globals.css';
function MyApp({ Component, pageProps }: AppProps) {
useEffect(() => {
if (process.env.NEXT_PUBLIC_GTM_ID && process.env.NEXT_PUBLIC_GTM_ID.length > 0) {
TagManager.initialize({ gtmId: process.env.NEXT_PUBLIC_GTM_ID });
}
}, []);
return (
<Layout>
<Component {...pageProps} />
</Layout>
);
}
export default MyApp;