2021-08-13 04:16:37 -04:00
|
|
|
import { MDXProvider } from "@mdx-js/react";
|
2021-06-26 23:33:09 -04:00
|
|
|
import { NextComponentType, NextPageContext } from "next";
|
|
|
|
import { AppProps as DefaultAppProps } from "next/app";
|
2021-08-13 04:16:37 -04:00
|
|
|
import React, { ComponentType, ReactNode } from "react";
|
|
|
|
|
|
|
|
import { DefaultLayout } from "@/components/DefaultLayout";
|
|
|
|
import { Footer } from "@/components/Footer";
|
|
|
|
import { Link } from "@/components/Link";
|
|
|
|
import { Navbar } from "@/components/Navbar";
|
2021-08-19 14:42:21 -04:00
|
|
|
import { ShapesBackground } from "@/components/ShapesBackground";
|
2021-08-13 04:16:37 -04:00
|
|
|
import { ThemeProvider } from "@/components/Theme";
|
|
|
|
|
2021-06-13 19:55:25 -04:00
|
|
|
import styles from "./_app.module.css";
|
|
|
|
|
2021-04-28 04:22:30 -04:00
|
|
|
import "./_app.css";
|
2021-05-09 00:35:57 -04:00
|
|
|
import "./font.css";
|
2021-06-07 20:55:37 -04:00
|
|
|
|
2021-04-25 19:13:07 -04:00
|
|
|
export default function App({ Component, pageProps }: AppProps): JSX.Element {
|
2021-06-26 23:33:09 -04:00
|
|
|
const Layout = Component.Layout ?? DefaultLayout;
|
|
|
|
|
2021-04-26 19:16:55 -04:00
|
|
|
return (
|
2021-08-03 19:37:02 -04:00
|
|
|
<ThemeProvider>
|
2021-06-07 20:55:37 -04:00
|
|
|
<MDXProvider components={{ a: Link }}>
|
2021-06-13 19:55:25 -04:00
|
|
|
<div className={styles.appContainer}>
|
|
|
|
<Navbar />
|
2021-08-19 14:42:21 -04:00
|
|
|
{/* Wrapping content with a ShapesBackground to allow for shapes in the background and a display: block parent */}
|
|
|
|
<ShapesBackground>
|
2021-06-26 23:33:09 -04:00
|
|
|
<Layout>
|
|
|
|
<Component {...pageProps} />
|
|
|
|
</Layout>
|
2021-08-19 14:42:21 -04:00
|
|
|
</ShapesBackground>
|
2021-06-13 19:55:25 -04:00
|
|
|
<Footer />
|
|
|
|
</div>
|
2021-04-28 04:22:30 -04:00
|
|
|
</MDXProvider>
|
|
|
|
</ThemeProvider>
|
2021-04-26 19:16:55 -04:00
|
|
|
);
|
2021-04-25 19:13:07 -04:00
|
|
|
}
|
2021-06-26 23:33:09 -04:00
|
|
|
|
|
|
|
type PageComponent = NextComponentType<
|
|
|
|
NextPageContext,
|
|
|
|
unknown,
|
|
|
|
Record<string, unknown>
|
|
|
|
> & {
|
|
|
|
Layout?: ComponentType<{ children: ReactNode }>;
|
|
|
|
};
|
|
|
|
|
|
|
|
type AppProps = DefaultAppProps & {
|
|
|
|
Component: PageComponent;
|
|
|
|
};
|