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/page/page-sidebar.tsx | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 src/components/templates/page/page-sidebar.tsx

(limited to 'src/components/templates/page/page-sidebar.tsx')

diff --git a/src/components/templates/page/page-sidebar.tsx b/src/components/templates/page/page-sidebar.tsx
new file mode 100644
index 0000000..1b5ae97
--- /dev/null
+++ b/src/components/templates/page/page-sidebar.tsx
@@ -0,0 +1,20 @@
+import { type ForwardRefRenderFunction, forwardRef } from 'react';
+import { Aside, type AsideProps } from '../../atoms';
+import styles from './page.module.scss';
+
+export type PageSidebarProps = AsideProps;
+
+const PageSidebarWithRef: ForwardRefRenderFunction<
+  HTMLElement,
+  PageSidebarProps
+> = ({ children, className = '', ...props }, ref) => {
+  const sidebarClass = `${styles.sidebar} ${className}`;
+
+  return (
+    <Aside {...props} className={sidebarClass} ref={ref}>
+      <div className={styles.sidebar__body}>{children}</div>
+    </Aside>
+  );
+};
+
+export const PageSidebar = forwardRef(PageSidebarWithRef);
-- 
cgit v1.2.3

