From 5704aaad084be98ceaaefc8507131b3e6f913316 Mon Sep 17 00:00:00 2001 From: Steven Date: Wed, 17 Jul 2024 22:48:22 +0800 Subject: [PATCH] chore: tweak embeded memo style --- .../components/HomeSidebar/TagsSection.tsx | 24 ++++++------ .../EmbeddedContent/EmbeddedMemo.tsx | 38 +++++++++---------- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/web/src/components/HomeSidebar/TagsSection.tsx b/web/src/components/HomeSidebar/TagsSection.tsx index 2ee095de..d8a11d68 100644 --- a/web/src/components/HomeSidebar/TagsSection.tsx +++ b/web/src/components/HomeSidebar/TagsSection.tsx @@ -60,17 +60,19 @@ const TagsSection = (props: Props) => {
{t("common.tags")} - - - - - -
- Tree mode - setTreeMode(event.target.checked)} /> -
-
-
+ {tagAmounts.length > 0 && ( + + + + + +
+ Tree mode + setTreeMode(event.target.checked)} /> +
+
+
+ )}
{tagAmounts.length > 0 ? ( treeMode ? ( diff --git a/web/src/components/MemoContent/EmbeddedContent/EmbeddedMemo.tsx b/web/src/components/MemoContent/EmbeddedContent/EmbeddedMemo.tsx index a28e4d98..b53b81e1 100644 --- a/web/src/components/MemoContent/EmbeddedContent/EmbeddedMemo.tsx +++ b/web/src/components/MemoContent/EmbeddedContent/EmbeddedMemo.tsx @@ -1,3 +1,4 @@ +import clsx from "clsx"; import copy from "copy-to-clipboard"; import { useContext, useEffect } from "react"; import toast from "react-hot-toast"; @@ -43,22 +44,20 @@ const EmbeddedMemo = ({ resourceId: uid, params: paramsStr }: Props) => { // Add the memo to the set of embedded memos. This is used to prevent infinite loops when a memo embeds itself. context.embeddedMemos.add(resourceName); const contentNode = useSnippet ? ( -
{memo.snippet}
+
{memo.snippet}
) : ( - + <> + + + ); if (inlineMode) { - return ( -
- {contentNode} - -
- ); + return
{contentNode}
; } const copyMemoUid = (uid: string) => { @@ -67,22 +66,21 @@ const EmbeddedMemo = ({ resourceId: uid, params: paramsStr }: Props) => { }; return ( -
-
-
+
+
+
- copyMemoUid(memo.uid)}> + copyMemoUid(memo.uid)}> {memo.uid.slice(0, 8)} - - + +
{contentNode} -
); };