Computer Science Club of the University of Waterloo's website.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
www-new/pages/_app.tsx

48 lines
1.3 KiB

import { MDXProvider } from "@mdx-js/react";
import { NextComponentType, NextPageContext } from "next";
import { AppProps as DefaultAppProps } from "next/app";
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";
import { ThemeProvider } from "@/components/Theme";
import styles from "./_app.module.css";
import "./_app.css";
import "./font.css";
export default function App({ Component, pageProps }: AppProps): JSX.Element {
const Layout = Component.Layout ?? DefaultLayout;
return (
<ThemeProvider>
<MDXProvider components={{ a: Link }}>
<div className={styles.appContainer}>
<Navbar />
{/* Wrapping content with a div to allow for a display: block parent */}
<div className={styles.contentContainer}>
<Layout>
<Component {...pageProps} />
</Layout>
</div>
<Footer />
</div>
</MDXProvider>
</ThemeProvider>
);
}
type PageComponent = NextComponentType<
NextPageContext,
unknown,
Record<string, unknown>
> & {
Layout?: ComponentType<{ children: ReactNode }>;
};
type AppProps = DefaultAppProps & {
Component: PageComponent;
};