Prepare pages folder for NextJS

This commit is contained in:
Aarni Halinen
2020-12-29 18:26:32 +02:00
parent 5344ab2483
commit 2ac298d4aa
30 changed files with 170 additions and 187 deletions
+25
View File
@@ -0,0 +1,25 @@
import React, { ReactNode, ComponentType } from "react";
import Header from "@components/Header";
import Footer from "@components/Footer/Footer";
interface PageProps {
page: ComponentType;
}
const PageWrapper: React.FC<PageProps> = ({ page, ...props }) => {
const Page = page;
return (
<>
<Header />
<Page {...props} />
<Footer />
</>
)
}
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
const renderPage = (Page: ReactNode) => (props: any): JSX.Element => (
<PageWrapper page={Page} {...props} />
);
export default renderPage;