Files
sign/apps/web/pages/_app.tsx

53 lines
1.6 KiB
TypeScript
Raw Normal View History

2022-12-06 13:45:23 +01:00
import { ReactElement, ReactNode } from "react";
import { NextPage } from "next";
2023-04-04 22:02:32 +00:00
import type { AppProps } from "next/app";
import { Montserrat, Qwigley } from "next/font/google";
2023-05-06 16:08:21 +10:00
import { SubscriptionProvider } from "@documenso/lib/stripe/providers/subscription-provider";
2023-04-04 22:02:32 +00:00
import "../../../node_modules/placeholder-loading/src/scss/placeholder-loading.scss";
import "../../../node_modules/react-resizable/css/styles.css";
import "../styles/tailwind.css";
import { SessionProvider } from "next-auth/react";
2023-01-13 19:01:58 +01:00
import { Toaster } from "react-hot-toast";
2023-04-04 22:02:32 +00:00
import "react-tooltip/dist/react-tooltip.css";
export { coloredConsole } from "@documenso/lib";
2022-11-14 23:12:51 +01:00
const montserrat = Montserrat({
subsets: ["latin"],
weight: ["400", "700"],
display: "swap",
variable: "--font-sans",
});
const qwigley = Qwigley({
subsets: ["latin"],
weight: ["400"],
display: "swap",
variable: "--font-qwigley",
});
2022-12-06 13:45:23 +01:00
export type NextPageWithLayout<P = {}, IP = P> = NextPage<P, IP> & {
getLayout?: (page: ReactElement) => ReactNode;
};
type AppPropsWithLayout = AppProps & {
Component: NextPageWithLayout;
};
2023-04-04 22:10:30 +00:00
export default function App({
Component,
2023-05-06 16:08:21 +10:00
pageProps: { session, initialSubscription, ...pageProps },
2023-04-04 22:10:30 +00:00
}: AppPropsWithLayout) {
2022-12-06 13:45:23 +01:00
const getLayout = Component.getLayout || ((page: any) => page);
2023-01-11 18:31:30 +01:00
return (
<SessionProvider session={session}>
2023-05-06 16:08:21 +10:00
<SubscriptionProvider initialSubscription={initialSubscription}>
2023-05-30 02:36:43 -04:00
<main className={`${montserrat.variable} h-full font-sans`}>
<Toaster position="top-center" />
{getLayout(<Component {...pageProps} />)}
2023-05-30 02:36:43 -04:00
</main>
2023-05-06 16:08:21 +10:00
</SubscriptionProvider>
</SessionProvider>
);
2022-11-14 23:12:51 +01:00
}