From 6d5491fdcbccfad7af6c6dcc63ce2f67abd3850c Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Sat, 17 Jun 2023 19:07:40 +0000
Subject: [PATCH] collapsible toc

---
 quartz/components/Header.tsx |   35 ++++++++++++++++++++---------------
 1 files changed, 20 insertions(+), 15 deletions(-)

diff --git a/quartz/components/Header.tsx b/quartz/components/Header.tsx
index cb2fae8..197c4e5 100644
--- a/quartz/components/Header.tsx
+++ b/quartz/components/Header.tsx
@@ -1,20 +1,25 @@
-import { resolveToRoot } from "../path"
-import Darkmode from "./Darkmode"
-import style from '../styles/header.scss'
+import { QuartzComponentConstructor, QuartzComponentProps } from "./types"
 
-export interface HeaderProps {
-  title: string
-  slug: string
-}
-
-export default function Header({ title, slug }: HeaderProps) {
-  const baseDir = resolveToRoot(slug)
+function Header({ children }: QuartzComponentProps) {
   return <header>
-    <h1><a href={baseDir}>{title}</a></h1>
-    <div class="spacer"></div>
-    <Darkmode />
+    {children}
   </header>
 }
 
-Header.beforeDOMLoaded = Darkmode.beforeDOMLoaded
-Header.css = style + Darkmode.css
+Header.css = `
+header {
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  margin: 1em 0 2em 0;
+  & > h1 {
+  }
+}
+
+header > h1 {
+  margin: 0;
+  flex: auto;
+}
+`
+
+export default (() => Header) satisfies QuartzComponentConstructor

--
Gitblit v1.10.0