2021-06-26 23:33:09 -04:00
|
|
|
import React, { ComponentType, ReactNode } from "react";
|
|
|
|
import { NextComponentType, NextPageContext } from "next";
|
|
|
|
import { AppProps as DefaultAppProps } from "next/app";
|
2021-04-26 19:16:55 -04:00
|
|
|
import { MDXProvider } from "@mdx-js/react";
|
2021-04-28 04:22:30 -04:00
|
|
|
import { ThemeProvider } from "../components/theme";
|
2021-05-18 03:16:32 -04:00
|
|
|
import { Navbar } from "../components/Navbar";
|
2021-06-13 19:55:25 -04:00
|
|
|
import { Footer } from "../components/Footer";
|
|
|
|
import { Link } from "../components/Link";
|
2021-07-18 03:37:48 -04:00
|
|
|
import { DefaultLayout } from "../components/DefaultLayout";
|
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-04-28 04:22:30 -04:00
|
|
|
<ThemeProvider theme="light">
|
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 />
|
|
|
|
{/* Wrapping content with a div to allow for a display: block parent */}
|
|
|
|
<div className={styles.contentContainer}>
|
2021-06-26 23:33:09 -04:00
|
|
|
<Layout>
|
|
|
|
<Component {...pageProps} />
|
|
|
|
</Layout>
|
2021-06-13 19:55:25 -04:00
|
|
|
</div>
|
|
|
|
<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;
|
|
|
|
};
|