From 4f1181581e177dd80a76165a0f930ef4577f9c6a Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Wed, 22 Nov 2023 19:07:25 +0100
Subject: refactor(components): integrate sectioned page template into Page

* replace Section component by a generic one (other components should
be able to use it)
* add a PageSection component
* add `hasSections` prop to Page component
* remove sectioned-page template
---
 src/pages/index.tsx | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

(limited to 'src/pages/index.tsx')

diff --git a/src/pages/index.tsx b/src/pages/index.tsx
index b8f754b..56de5b5 100644
--- a/src/pages/index.tsx
+++ b/src/pages/index.tsx
@@ -18,10 +18,11 @@ import {
   Icon,
   List,
   ListItem,
-  Section,
-  type SectionProps,
   Time,
   MetaItem,
+  type PageSectionProps,
+  PageSection,
+  Page,
 } from '../components';
 import { mdxComponents } from '../components/mdx';
 import HomePageContent from '../content/pages/homepage.mdx';
@@ -213,14 +214,18 @@ const StyledGrid = ({ children }: { children: ReactNode }) => (
  * @param {ReactNode[]} obj.children - The section body.
  * @returns {JSX.Element} A section element.
  */
-const HomePageSection: FC<SectionProps> = ({
+const HomePageSection: FC<PageSectionProps> = ({
   children,
   hasBorder = true,
   variant,
 }) => (
-  <Section className={styles.section} hasBorder={hasBorder} variant={variant}>
+  <PageSection
+    className={styles.section}
+    hasBorder={hasBorder}
+    variant={variant}
+  >
     {children}
-  </Section>
+  </PageSection>
 );
 
 type HomeProps = {
@@ -349,7 +354,9 @@ const HomePage: NextPageWithLayout<HomeProps> = ({ recentPosts }) => {
         type="application/ld+json"
         dangerouslySetInnerHTML={{ __html: JSON.stringify(breadcrumbSchema) }}
       />
-      <HomePageContent components={components} />
+      <Page hasSections>
+        <HomePageContent components={components} />
+      </Page>
     </>
   );
 };
-- 
cgit v1.2.3

