Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

chore: hide actions for comment

Johnnyf5d5ebea6fe0
diff --git a/web/src/components/MemoActionMenu.tsx b/web/src/components/MemoActionMenu.tsx
index 29be1442d..7c955e6a5 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) => {
</span>
</MenuButton>
<Menu className="text-sm" size="sm" placement="bottom-end">
- {!readonly && !isArchived && (
+ {!readonly && !isArchived && !isComment && (
<>
<MenuItem onClick={handleTogglePinMemoBtnClick}>
{memo.pinned ? <BookmarkMinusIcon className="w-4 h-auto" /> : <BookmarkPlusIcon className="w-4 h-auto" />}
@@ -190,16 +191,18 @@ const MemoActionMenu = (props: Props) => {
)}
{!readonly && (
<>
- {!isArchived && hasCompletedTaskList && (
+ {!isArchived && !isComment && hasCompletedTaskList && (
<MenuItem color="warning" onClick={handleRemoveCompletedTaskListItemsClick}>
<SquareCheckIcon className="w-4 h-auto" />
{t("memo.remove-completed-task-list-items")}
</MenuItem>
)}
- <MenuItem color="warning" onClick={handleToggleMemoStatusClick}>
- {isArchived ? <ArchiveRestoreIcon className="w-4 h-auto" /> : <ArchiveIcon className="w-4 h-auto" />}
- {isArchived ? t("common.restore") : t("common.archive")}
- </MenuItem>
+ {!isComment && (
+ <MenuItem color="warning" onClick={handleToggleMemoStatusClick}>
+ {isArchived ? <ArchiveRestoreIcon className="w-4 h-auto" /> : <ArchiveIcon className="w-4 h-auto" />}
+ {isArchived ? t("common.restore") : t("common.archive")}
+ </MenuItem>
+ )}
<MenuItem color="danger" onClick={handleDeleteMemoClick}>
<TrashIcon className="w-4 h-auto" />
{t("common.delete")}