diff options
| author | Armand Philippot <git@armandphilippot.com> | 2023-11-22 19:07:25 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2023-11-23 11:44:28 +0100 |
| commit | 4f1181581e177dd80a76165a0f930ef4577f9c6a (patch) | |
| tree | 6029f86d42af7700f5b59cd1477854190bab65c6 /src/pages/index.tsx | |
| parent | 329e7c89bac50be9db2c6d2ec6751ab0ffad42ac (diff) | |
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
Diffstat (limited to 'src/pages/index.tsx')
| -rw-r--r-- | src/pages/index.tsx | 19 |
1 files changed, 13 insertions, 6 deletions
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> </> ); }; |
