From f5d5ebea6fe0a596ea61d21bcb6fd7f9d2f1dd0e Mon Sep 17 00:00:00 2001 From: Johnny Date: Sun, 6 Apr 2025 22:58:43 +0800 Subject: [PATCH] chore: hide actions for comment --- web/src/components/MemoActionMenu.tsx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/web/src/components/MemoActionMenu.tsx b/web/src/components/MemoActionMenu.tsx index 29be1442..7c955e6a 100644 --- a/web/src/components/MemoActionMenu.tsx +++ b/web/src/components/MemoActionMenu.tsx @@ -49,9 +49,10 @@ const MemoActionMenu = (props: Props) => { const location = useLocation(); const navigateTo = useNavigateTo(); const memoStore = useMemoStore(); - const isArchived = memo.state === State.ARCHIVED; const hasCompletedTaskList = checkHasCompletedTaskList(memo); const isInMemoDetailPage = location.pathname.startsWith(`/${memo.name}`); + const isComment = Boolean(memo.parent); + const isArchived = memo.state === State.ARCHIVED; const memoUpdatedCallback = () => { // Refresh user stats. @@ -170,7 +171,7 @@ const MemoActionMenu = (props: Props) => { - {!readonly && !isArchived && ( + {!readonly && !isArchived && !isComment && ( <> {memo.pinned ? : } @@ -190,16 +191,18 @@ const MemoActionMenu = (props: Props) => { )} {!readonly && ( <> - {!isArchived && hasCompletedTaskList && ( + {!isArchived && !isComment && hasCompletedTaskList && ( {t("memo.remove-completed-task-list-items")} )} - - {isArchived ? : } - {isArchived ? t("common.restore") : t("common.archive")} - + {!isComment && ( + + {isArchived ? : } + {isArchived ? t("common.restore") : t("common.archive")} + + )} {t("common.delete")}