chore: hide actions for comment

pull/4614/head
Johnny 4 weeks ago
parent aa8cf44c41
commit f5d5ebea6f

@ -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…
Cancel
Save