Skip to content
This repository has been archived by the owner on Apr 5, 2024. It is now read-only.

Commit

Permalink
fix: approach
Browse files Browse the repository at this point in the history
  • Loading branch information
maxgfr committed Feb 11, 2022
1 parent 3134c3b commit 2a448f8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 16 deletions.
18 changes: 17 additions & 1 deletion pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
import "../styles/globals.css";
import type { AppProps } from "next/app";
import { Layout } from "@components";
import {
footerBodySection,
footerBottomSection,
footerPartnerSection,
footerTopSection,
headerBody,
headerNav,
} from "@config";

function MyApp({ Component, pageProps }: AppProps) {
return (
<Layout>
<Layout
headerProps={{ bodySection: headerBody, navSection: headerNav }}
footerProps={{
bodySection: footerBodySection,
bottomSection: footerBottomSection,
partnerSection: footerPartnerSection,
topSection: footerTopSection,
}}
>
<Component {...pageProps} />
</Layout>
);
Expand Down
22 changes: 7 additions & 15 deletions src/components/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,21 @@
import { Footer, Header } from "@components";
import {
footerBodySection,
footerBottomSection,
footerPartnerSection,
footerTopSection,
headerBody,
headerNav,
} from "@config";

import { Container } from "@dataesr/react-dsfr";
import { FooterProps } from "./footer/type";
import { HeaderProps } from "./header/type";

type Props = {
children: React.ReactNode;
headerProps: HeaderProps;
footerProps: FooterProps;
};

const Index = (props: Props): JSX.Element => {
return (
<>
<Header bodySection={headerBody} navSection={headerNav} />
<Header {...props.headerProps} />
<Container>{props.children}</Container>
<Footer
topSection={footerTopSection}
bodySection={footerBodySection}
partnerSection={footerPartnerSection}
bottomSection={footerBottomSection}
/>
<Footer {...props.footerProps} />
</>
);
};
Expand Down

0 comments on commit 2a448f8

Please sign in to comment.