From 317cce9314ad78d90714dc55aa82a2c3dfa75d1a Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Thu, 08 Jun 2023 05:27:32 +0000
Subject: [PATCH] generic quartz component for layout

---
 quartz/components/Body.tsx |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/quartz/components/Body.tsx b/quartz/components/Body.tsx
index 1d9296b..92e6682 100644
--- a/quartz/components/Body.tsx
+++ b/quartz/components/Body.tsx
@@ -1,15 +1,14 @@
-import { ComponentChildren } from "preact"
 import clipboardScript from './scripts/clipboard.inline'
 import clipboardStyle from './styles/clipboard.scss'
+import { QuartzComponentProps } from "./types"
 
-export interface BodyProps {
-  title?: string
-  children: ComponentChildren
-}
-
-export default function Body({ title, children }: BodyProps) {
+export default function Body({ fileData, children }: QuartzComponentProps) {
+  const title = fileData.frontmatter?.title
+  const displayTitle = fileData.slug === "index" ? undefined : title
   return <article>
-    {title && <h1>{title}</h1>}
+    <div class="top-section">
+      {displayTitle && <h1>{displayTitle}</h1>}
+    </div>
     {children}
   </article>
 }

--
Gitblit v1.10.0