From e9fb0ecb96a2de53cf5f060c4e151f539ca4b089 Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Fri, 02 Feb 2024 05:19:51 +0000
Subject: [PATCH] fix: border radius on search preview
---
quartz/components/TableOfContents.tsx | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/quartz/components/TableOfContents.tsx b/quartz/components/TableOfContents.tsx
index 67f29d5..167c837 100644
--- a/quartz/components/TableOfContents.tsx
+++ b/quartz/components/TableOfContents.tsx
@@ -1,6 +1,7 @@
import { QuartzComponentConstructor, QuartzComponentProps } from "./types"
import legacyStyle from "./styles/legacyToc.scss"
import modernStyle from "./styles/toc.scss"
+import { classNames } from "../util/lang"
// @ts-ignore
import script from "./scripts/toc.inline"
@@ -13,14 +14,14 @@
layout: "modern",
}
-function TableOfContents({ fileData }: QuartzComponentProps) {
+function TableOfContents({ fileData, displayClass }: QuartzComponentProps) {
if (!fileData.toc) {
return null
}
return (
- <div class="desktop-only">
- <button type="button" id="toc">
+ <div class={classNames(displayClass, "toc")}>
+ <button type="button" id="toc" class={fileData.collapseToc ? "collapsed" : ""}>
<h3>Table of Contents</h3>
<svg
xmlns="http://www.w3.org/2000/svg"
@@ -60,7 +61,7 @@
}
return (
- <details id="toc" open>
+ <details id="toc" open={!fileData.collapseToc}>
<summary>
<h3>Table of Contents</h3>
</summary>
--
Gitblit v1.10.0