diff --git a/web/src/components/HomeSidebar/ShortcutsSection.tsx b/web/src/components/HomeSidebar/ShortcutsSection.tsx index 4ff79a2f..e963a28e 100644 --- a/web/src/components/HomeSidebar/ShortcutsSection.tsx +++ b/web/src/components/HomeSidebar/ShortcutsSection.tsx @@ -1,4 +1,4 @@ -import { Dropdown, Menu, MenuButton, MenuItem, Tooltip } from "@mui/joy"; +import { Tooltip } from "@mui/joy"; import { Edit3Icon, MoreVerticalIcon, TrashIcon, PlusIcon } from "lucide-react"; import { observer } from "mobx-react-lite"; import { shortcutServiceClient } from "@/grpcweb"; @@ -10,6 +10,7 @@ import { Shortcut } from "@/types/proto/api/v1/shortcut_service"; import { cn } from "@/utils"; import { useTranslate } from "@/utils/i18n"; import showCreateShortcutDialog from "../CreateShortcutDialog"; +import { Popover, PopoverContent, PopoverTrigger } from "../ui/Popover"; const emojiRegex = /^(\p{Emoji_Presentation}|\p{Emoji}\uFE0F)$/u; @@ -56,21 +57,29 @@ const ShortcutsSection = observer(() => { {emoji && {emoji}} {title.trim()} - - - - - - showCreateShortcutDialog({ shortcut })}> - - {t("common.edit")} - - handleDeleteShortcut(shortcut)}> - - {t("common.delete")} - - - + + + + + +
+ + +
+
+
); })} diff --git a/web/src/components/HomeSidebar/TagsSection.tsx b/web/src/components/HomeSidebar/TagsSection.tsx index 2c79ebd4..db418279 100644 --- a/web/src/components/HomeSidebar/TagsSection.tsx +++ b/web/src/components/HomeSidebar/TagsSection.tsx @@ -1,4 +1,3 @@ -import { Dropdown, Menu, MenuButton, MenuItem } from "@mui/joy"; import { Switch } from "@usememos/mui"; import { Edit3Icon, HashIcon, MoreVerticalIcon, TagsIcon, TrashIcon } from "lucide-react"; import { observer } from "mobx-react-lite"; @@ -75,24 +74,32 @@ const TagsSection = observer((props: Props) => { key={tag} className="shrink-0 w-auto max-w-full text-sm rounded-md leading-6 flex flex-row justify-start items-center select-none hover:opacity-80 text-gray-600 dark:text-gray-400 dark:border-zinc-800" > - - -
+ + +
- - - showRenameTagDialog({ tag: tag })}> - - {t("common.rename")} - - handleDeleteTag(tag)}> - - {t("common.delete")} - - - +
+ +
+ + +
+
+
handleTagClick(tag)} diff --git a/web/src/components/MemoActionMenu.tsx b/web/src/components/MemoActionMenu.tsx index a27c1101..da0c8f77 100644 --- a/web/src/components/MemoActionMenu.tsx +++ b/web/src/components/MemoActionMenu.tsx @@ -1,4 +1,3 @@ -import { Dropdown, Menu, MenuButton, MenuItem } from "@mui/joy"; import copy from "copy-to-clipboard"; import { ArchiveIcon, @@ -22,6 +21,7 @@ import { NodeType } from "@/types/proto/api/v1/markdown_service"; import { Memo } from "@/types/proto/api/v1/memo_service"; import { cn } from "@/utils"; import { useTranslate } from "@/utils/i18n"; +import { Popover, PopoverContent, PopoverTrigger } from "./ui/Popover"; interface Props { memo: Memo; @@ -163,55 +163,75 @@ const MemoActionMenu = observer((props: Props) => { }; return ( - - - + + + - - - {!readonly && !isArchived && ( - <> - {!isComment && ( - - {memo.pinned ? : } - {memo.pinned ? t("common.unpin") : t("common.pin")} - - )} - - - {t("common.edit")} - - - )} - {!isArchived && ( - - - {t("memo.copy-link")} - - )} - {!readonly && ( - <> - {!isArchived && !isComment && hasCompletedTaskList && ( - - - {t("memo.remove-completed-task-list-items")} - - )} - {!isComment && ( - - {isArchived ? : } - {isArchived ? t("common.restore") : t("common.archive")} - - )} - - - {t("common.delete")} - - - )} - - + + +
+ {!readonly && !isArchived && ( + <> + {!isComment && ( + + )} + + + )} + {!isArchived && ( + + )} + {!readonly && ( + <> + {!isArchived && !isComment && hasCompletedTaskList && ( + + )} + {!isComment && ( + + )} + + + )} +
+
+ ); }); diff --git a/web/src/components/MemoDisplaySettingMenu.tsx b/web/src/components/MemoDisplaySettingMenu.tsx index bcdb80b6..127da16e 100644 --- a/web/src/components/MemoDisplaySettingMenu.tsx +++ b/web/src/components/MemoDisplaySettingMenu.tsx @@ -22,7 +22,7 @@ const MemoDisplaySettingMenu = observer(({ className }: Props) => { -
+
{t("memo.direction")}