mirror of
https://github.com/lukevella/rallly.git
synced 2025-05-23 05:46:20 +02:00
⚡️ Use nextjs layout feature
This commit is contained in:
parent
02ef9000a7
commit
c2c000f770
9 changed files with 168 additions and 154 deletions
|
@ -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>;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue