Skip to content

Commit

Permalink
refactor commit - cleaned some things up for development
Browse files Browse the repository at this point in the history
  • Loading branch information
manishiwa committed May 5, 2024
1 parent 01c50c5 commit b780de6
Show file tree
Hide file tree
Showing 57 changed files with 600 additions and 0 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions app/(refactor)/[...not-found]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { notFound } from "next/navigation";

export default function NotFoundCatchAll() {
notFound();
}
74 changes: 74 additions & 0 deletions app/(refactor)/head.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import { IS_PRODUCTION } from "@/lib/helpers";
import { getCookie } from "cookies-next";
import Script from "next/script";

export default function Head() {
const consent = getCookie("growthepieCookieConsent");

return (
<>
<link
rel="apple-touch-icon"
sizes="180x180"
href="/apple-touch-icon.png"
/>
<link
rel="icon"
type="image/png"
sizes="32x32"
href="/favicon-32x32.png"
/>
<link
rel="icon"
type="image/png"
sizes="16x16"
href="/favicon-16x16.png"
/>
{/* <link rel="preload" as="image" href="/logo_pie_only.png" />
<link rel="preload" as="image" href="/logo_full.png" />
<link rel="preload" as="image" href="/logo_full_light.png" /> */}
<link rel="manifest" href="/site.webmanifest" />
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5" />
<meta name="msapplication-TileColor" content="#da532c" />

{IS_PRODUCTION && (
<>
<Script
id="gtag"
strategy="afterInteractive"
dangerouslySetInnerHTML={{
__html: `
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('consent', 'default', {
'ad_storage': 'denied',
'analytics_storage': 'denied'
});
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-WK73L5M');`,
}}
/>
{consent === true && (
<Script
id="consupd"
strategy="afterInteractive"
dangerouslySetInnerHTML={{
__html: `
gtag('consent', 'update', {
'ad_storage': 'granted',
'analytics_storage': 'granted'
});
`,
}}
/>
)}
</>
)}
</>
);
}
107 changes: 107 additions & 0 deletions app/(refactor)/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
import "../globals.css";
import { Analytics } from "@vercel/analytics/react";
import { Providers } from "../providers";
import CookieConsent from "@/components/layout/CookieConsent";
import { Raleway, Inter, Roboto_Mono } from "next/font/google";
import Header from "@/components/layout/Header";
import SidebarContainer from "@/components/layout/SidebarContainer";
import Head from "./head";
import Share from "@/components/Share";
import BottomBanner from "@/components/BottomBanner";
import { baseMetadata } from "@/refactor/lib/seo/metadata";
import { baseJsonLd } from "@/refactor/lib/seo/jsonLd";

import "../background.css";
import { Metadata } from "next";

export const metadata: Metadata = baseMetadata;

export const viewport = {
width: "device-width",
initialScale: "1.0",
themeColor: "dark",
};

// If loading a variable font, you don't need to specify the font weight
const raleway = Raleway({
subsets: ["latin"],
variable: "--font-raleway",
display: "swap",
});

const inter = Inter({
subsets: ["latin"],
variable: "--font-inter",
display: "swap",
});

const robotoMono = Roboto_Mono({
subsets: ["latin"],
variable: "--font-roboto-mono",
display: "swap",
});

export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html
lang="en"
className={`${raleway.variable} ${inter.variable} ${robotoMono.variable}`}
suppressHydrationWarning
>
<Head />
<body className="bg-forest-50 dark:bg-[#1F2726] text-forest-900 dark:text-forest-500 font-raleway !overflow-x-hidden overflow-y-scroll">
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(baseJsonLd) }}
/>
<Providers>
<div className="flex h-fit w-full justify-center">
<div className="flex w-full max-w-[1680px] min-h-screen">
<SidebarContainer />
<div className="flex flex-col flex-1 overflow-y-auto z-10 overflow-x-hidden relative min-h-full bg-white dark:bg-inherit">
<div className="w-full relative min-h-full">
<div className="background-container">
<div className="background-gradient-group">
<div className="background-gradient-yellow"></div>
<div className="background-gradient-green"></div>
</div>
</div>
<Header />
<main className="flex-1 w-full mx-auto z-10 mb-[165px]">
{children}
<div className="bg-blue-200 z-50"></div>
</main>
<BottomBanner />
</div>
</div>
<div className="z-50 flex fixed bottom-[20px] w-full max-w-[1680px] justify-end pointer-events-none">
<div className="pr-[20px] md:pr-[50px] pointer-events-auto">
<div className="relative flex gap-x-[15px] z-50 p-[5px] bg-forest-500 dark:bg-[#5A6462] rounded-full shadow-[0px_0px_50px_0px_#00000033] dark:shadow-[0px_0px_50px_0px_#000000]">
{/* <Details /> */}
<Share />
</div>
</div>
</div>
</div>
</div>
{process.env.NEXT_PUBLIC_VERCEL_ENV === "development" && (
<div className="fixed bottom-0 left-0 z-50 bg-white dark:bg-black text-xs px-1 py-0.5">
<div className="block sm:hidden">{"< sm"}</div>
<div className="hidden sm:block md:hidden">{"sm"}</div>
<div className="hidden md:block lg:hidden">{"md"}</div>
<div className="hidden lg:block xl:hidden">{"lg"}</div>
<div className="hidden xl:block 2xl:hidden">{"xl"}</div>
<div className="hidden 2xl:block">{"2xl"}</div>
</div>
)}
<CookieConsent />
</Providers>
<Analytics />
</body>
</html>
);
}
22 changes: 22 additions & 0 deletions app/(refactor)/not-found.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
"use client";
import Link from "next/link";
import { headers } from "next/headers";
import { useEffect, useState } from "react";
import { useMediaQuery } from "usehooks-ts";
import Icon from "@/components/layout/Icon";
import { navigationItems } from "@/lib/navigation";
import ErrorGen from "@/components/ErrorGen";
import React from "react";

export default function NotFound() {
return (
<>
<ErrorGen
header={"404 Page Not Found ..."}
subheader={
"The page you requested was not found. We can recommend checking out one of these pages:"
}
/>
</>
);
}
Loading

0 comments on commit b780de6

Please sign in to comment.