Skip to content

Commit

Permalink
feature: major refactor + overall site improvment
Browse files Browse the repository at this point in the history
  • Loading branch information
siradji committed Apr 13, 2024
1 parent 070d97f commit 1d22762
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 6 deletions.
Binary file modified public/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 32 additions & 6 deletions src/components/Pagewrapper.tsx
Original file line number Diff line number Diff line change
@@ -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?: {
Expand Down Expand Up @@ -41,7 +55,10 @@ export const PageWrapper: FC<PropsWithChildren<PagewrapperProps>> = ({
<Head>
<title>{`${title} - Food Delivery`}</title>
<meta name="description" content={description} />
<meta property="og:site_name" content={`${title}`} />
<meta
property="og:site_name"
content={`${title}`}
/>
<meta property="og:type" content="website" />
<meta property="twitter:card" content="summary_large_image" />
<meta
Expand All @@ -50,11 +67,17 @@ export const PageWrapper: FC<PropsWithChildren<PagewrapperProps>> = ({
content={`${domain}${routePath}`}
/>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta property="og:title" content={`${title} - Food Delivery`} />
<meta
property="og:title"
content={`${title} - Food Delivery`}
/>
<meta property="og:description" content={description} />
<meta property="og:image" content={`${domain}${image}`} />
<meta property="twitter:url" content={`${domain}${routePath}`} />
<meta property="twitter:title" content={`${title} - Food Delivery`} />
<meta
property="twitter:title"
content={`${title} - Food Delivery`}
/>
<meta property="twitter:description" content={description} />
<meta property="twitter:image" content={`${domain}${image}`} />
<link
Expand All @@ -69,13 +92,16 @@ export const PageWrapper: FC<PropsWithChildren<PagewrapperProps>> = ({
sizes="16x16"
href="/favicon-16x16.png"
/>
<Script
id="segment-script"
dangerouslySetInnerHTML={{ __html: renderSnippet() }}
/>
</Head>
<div className="md:container lg:py-5 pb-20">
<Header />
<main>{children}</main>
</div>
<Footer />
<Analytics />
</div>
);
};

0 comments on commit 1d22762

Please sign in to comment.