From 70b4f633a6fbedb58c8b9134ac64ede854d489de Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Mon, 20 Nov 2023 12:27:46 +0100
Subject: refactor(components): replace PageLayout template with Page

* split pages in smaller components (it is both easier to maintain and
more readable, we avoid the use of fragments in pages directory)
* extract breadcrumbs from article tag (the navigation is not related
to the page contents)
* remove useReadingTime hook
* remove layout options except `isHome`
---
 src/components/templates/layout/layout.tsx | 25 +++----------------------
 1 file changed, 3 insertions(+), 22 deletions(-)

(limited to 'src/components/templates/layout/layout.tsx')

diff --git a/src/components/templates/layout/layout.tsx b/src/components/templates/layout/layout.tsx
index 055b1a1..953b0db 100644
--- a/src/components/templates/layout/layout.tsx
+++ b/src/components/templates/layout/layout.tsx
@@ -65,14 +65,6 @@ export type LayoutProps = {
    * @default false
    */
   isHome?: boolean;
-  /**
-   * Determine if article has a comments section.
-   */
-  withExtraPadding?: boolean;
-  /**
-   * Determine if article should use grid. Default: false.
-   */
-  useGrid?: boolean;
 };
 
 /**
@@ -80,17 +72,10 @@ export type LayoutProps = {
  *
  * Render the base layout used by all pages.
  */
-export const Layout: FC<LayoutProps> = ({
-  children,
-  withExtraPadding = false,
-  isHome,
-  useGrid = false,
-}) => {
+export const Layout: FC<LayoutProps> = ({ children, isHome }) => {
   const router = useRouter();
   const intl = useIntl();
   const { baseline, copyright, locales, name, url } = CONFIG;
-  const articleGridClass = useGrid ? 'article--grid' : '';
-  const articleCommentsClass = withExtraPadding ? 'article--padding' : '';
 
   const skipToContent = intl.formatMessage({
     defaultMessage: 'Skip to content',
@@ -455,11 +440,7 @@ export const Layout: FC<LayoutProps> = ({
         </div>
       </Header>
       <Main id="main" className={styles.main}>
-        <article
-          className={`${styles[articleGridClass]} ${styles[articleCommentsClass]}`}
-        >
-          {children}
-        </article>
+        {children}
       </Main>
       <Footer className={styles.footer}>
         <Colophon
@@ -495,5 +476,5 @@ export const Layout: FC<LayoutProps> = ({
  */
 export const getLayout = (
   page: ReactElement,
-  props: NextPageWithLayoutOptions
+  props?: NextPageWithLayoutOptions
 ) => <Layout {...props}>{page}</Layout>;
-- 
cgit v1.2.3

