mirror of https://github.com/usememos/memos.git
Adds tooltip to Link Memo & Attachments, modifies en.json for button names
This commit is contained in:
parent
c2174887bc
commit
57c43b5f69
|
|
@ -13,6 +13,7 @@ import { extractUserIdFromName } from "@/store/common";
|
|||
import { Memo, MemoRelation_Memo, MemoRelation_Type } from "@/types/proto/api/v1/memo_service";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
import { MemoEditorContext } from "../types";
|
||||
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip";
|
||||
|
||||
const AddMemoRelationPopover = () => {
|
||||
const t = useTranslate();
|
||||
|
|
@ -95,11 +96,20 @@ const AddMemoRelationPopover = () => {
|
|||
|
||||
return (
|
||||
<Popover open={popoverOpen} onOpenChange={setPopoverOpen}>
|
||||
<PopoverTrigger asChild>
|
||||
<Button variant="ghost" size="icon">
|
||||
<LinkIcon className="size-5" />
|
||||
</Button>
|
||||
</PopoverTrigger>
|
||||
<TooltipProvider>
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<PopoverTrigger asChild>
|
||||
<Button variant="ghost" size="icon">
|
||||
<LinkIcon className="size-5" />
|
||||
</Button>
|
||||
</PopoverTrigger>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent side="bottom">
|
||||
<p>{t("tooltip.link-memo")}</p>
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
</TooltipProvider>
|
||||
<PopoverContent align="center">
|
||||
<div className="w-[16rem] p-1 flex flex-col justify-start items-start">
|
||||
{/* Search and selection interface */}
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ const MarkdownMenu = (props: Props) => {
|
|||
</DropdownMenuTrigger>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent side="bottom">
|
||||
<p>{t("tooltip.codeblock-checkbox")}</p>
|
||||
<p>{t("tooltip.markdown-menu")}</p>
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
</TooltipProvider>
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ import { Button } from "@/components/ui/button";
|
|||
import { attachmentStore } from "@/store";
|
||||
import { Attachment } from "@/types/proto/api/v1/attachment_service";
|
||||
import { MemoEditorContext } from "../types";
|
||||
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip";
|
||||
import { t } from "i18next";
|
||||
|
||||
interface Props {
|
||||
isUploading?: boolean;
|
||||
|
|
@ -73,19 +75,28 @@ const UploadAttachmentButton = observer((props: Props) => {
|
|||
const isUploading = state.uploadingFlag || props.isUploading;
|
||||
|
||||
return (
|
||||
<Button className="relative" variant="ghost" size="icon" disabled={isUploading}>
|
||||
{isUploading ? <LoaderIcon className="size-5 animate-spin" /> : <PaperclipIcon className="size-5" />}
|
||||
<input
|
||||
className="absolute inset-0 w-full h-full opacity-0 cursor-pointer"
|
||||
ref={fileInputRef}
|
||||
disabled={isUploading}
|
||||
onChange={handleFileInputChange}
|
||||
type="file"
|
||||
id="files"
|
||||
multiple={true}
|
||||
accept="*"
|
||||
/>
|
||||
</Button>
|
||||
<TooltipProvider>
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<Button className="relative" variant="ghost" size="icon" disabled={isUploading}>
|
||||
{isUploading ? <LoaderIcon className="size-5 animate-spin" /> : <PaperclipIcon className="size-5" />}
|
||||
<input
|
||||
className="absolute inset-0 w-full h-full opacity-0 cursor-pointer"
|
||||
ref={fileInputRef}
|
||||
disabled={isUploading}
|
||||
onChange={handleFileInputChange}
|
||||
type="file"
|
||||
id="files"
|
||||
multiple={true}
|
||||
accept="*"
|
||||
/>
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent side="bottom">
|
||||
<p>{t("tooltip.upload-attachment")}</p>
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
</TooltipProvider>
|
||||
);
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue