|
|
|
@ -1,5 +1,6 @@ |
|
|
|
|
import React from "react"; |
|
|
|
|
import { AppProps } from "next/app"; |
|
|
|
|
import React, { ComponentType, ReactNode } from "react"; |
|
|
|
|
import { NextComponentType, NextPageContext } from "next"; |
|
|
|
|
import { AppProps as DefaultAppProps } from "next/app"; |
|
|
|
|
import { MDXProvider } from "@mdx-js/react"; |
|
|
|
|
import { ThemeProvider } from "../components/theme"; |
|
|
|
|
import { Navbar } from "../components/Navbar"; |
|
|
|
@ -11,6 +12,8 @@ import "./_app.css"; |
|
|
|
|
import "./font.css"; |
|
|
|
|
|
|
|
|
|
export default function App({ Component, pageProps }: AppProps): JSX.Element { |
|
|
|
|
const Layout = Component.Layout ?? DefaultLayout; |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<ThemeProvider theme="light"> |
|
|
|
|
<MDXProvider components={{ a: Link }}> |
|
|
|
@ -18,7 +21,9 @@ export default function App({ Component, pageProps }: AppProps): JSX.Element { |
|
|
|
|
<Navbar /> |
|
|
|
|
{/* Wrapping content with a div to allow for a display: block parent */} |
|
|
|
|
<div className={styles.contentContainer}> |
|
|
|
|
<Component {...pageProps} /> |
|
|
|
|
<Layout> |
|
|
|
|
<Component {...pageProps} /> |
|
|
|
|
</Layout> |
|
|
|
|
</div> |
|
|
|
|
<Footer /> |
|
|
|
|
</div> |
|
|
|
@ -26,3 +31,19 @@ export default function App({ Component, pageProps }: AppProps): JSX.Element { |
|
|
|
|
</ThemeProvider> |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function DefaultLayout(props: { children: React.ReactNode }) { |
|
|
|
|
return <div className={styles.defaultLayout}>{props.children}</div>; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
type PageComponent = NextComponentType< |
|
|
|
|
NextPageContext, |
|
|
|
|
unknown, |
|
|
|
|
Record<string, unknown> |
|
|
|
|
> & { |
|
|
|
|
Layout?: ComponentType<{ children: ReactNode }>; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
type AppProps = DefaultAppProps & { |
|
|
|
|
Component: PageComponent; |
|
|
|
|
}; |
|
|
|
|