mirror of
https://github.com/usememos/memos.git
synced 2025-12-16 05:43:06 +08:00
chore: hide actions for comment
This commit is contained in:
parent
aa8cf44c41
commit
f5d5ebea6f
1 changed files with 10 additions and 7 deletions
|
|
@ -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")}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue