diff --git a/public/favicon-32x32.png b/public/favicon-32x32.png index 1823964..b66b056 100644 Binary files a/public/favicon-32x32.png and b/public/favicon-32x32.png differ diff --git a/src/components/Pagewrapper.tsx b/src/components/Pagewrapper.tsx index c7793f0..2772be4 100644 --- a/src/components/Pagewrapper.tsx +++ b/src/components/Pagewrapper.tsx @@ -1,10 +1,24 @@ -import React, { FC, PropsWithChildren, useMemo, useEffect } from 'react'; +import React, { FC, PropsWithChildren, useMemo } from 'react'; import Head from 'next/head'; import { useRouter } from 'next/router'; import { Header } from '@/components/layout/Header'; import { Footer } from '@/components/layout/Footer'; -import Analytics from '@/components/analytics'; +import Script from 'next/script' +import * as snippet from '@segment/snippet' + +function renderSnippet() { + const opts = { + apiKey: process.env.NEXT_PUBLIC_ANALYTICS_WRITE_KEY, + page: true, + } + + if (process.env.NODE_ENV === 'development') { + return snippet.max(opts) + } + + return snippet.min(opts) +} interface Page { seo?: { @@ -41,7 +55,10 @@ export const PageWrapper: FC> = ({ {`${title} - Food Delivery`} - + > = ({ content={`${domain}${routePath}`} /> - + - + > = ({ sizes="16x16" href="/favicon-16x16.png" /> +