️ Use nextjs layout feature

This commit is contained in:
Luke Vella 2023-02-09 19:50:36 +00:00
parent 02ef9000a7
commit c2c000f770
9 changed files with 168 additions and 154 deletions

View file

@ -2,19 +2,28 @@ import React from "react";
import { DayjsProvider } from "@/utils/dayjs";
import { NextPageWithLayout } from "../../types";
import { UserProvider } from "../user-provider";
import { MobileNavigation } from "./standard-layout/mobile-navigation";
const StandardLayout: React.VoidFunctionComponent<{
children?: React.ReactNode;
}> = ({ children, ...rest }) => {
return (
<DayjsProvider>
<div className="bg-pattern relative min-h-full" {...rest}>
<MobileNavigation />
<div className="mx-auto max-w-4xl">{children}</div>
</div>
</DayjsProvider>
<UserProvider>
<DayjsProvider>
<div className={"bg-pattern relative min-h-full"} {...rest}>
<MobileNavigation />
<div className="mx-auto max-w-4xl">{children}</div>
</div>
</DayjsProvider>
</UserProvider>
);
};
export default StandardLayout;
export const getStandardLayout: NextPageWithLayout["getLayout"] =
function getLayout(page) {
return <StandardLayout>{page}</StandardLayout>;
};