Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
7079790d
Commit
7079790d
authored
Oct 23, 2025
by
Claude
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: add copy content functionality to MemoActionMenu
parent
686d31b3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
6 deletions
+36
-6
MemoActionMenu.tsx
web/src/components/MemoActionMenu.tsx
+32
-5
dropdown-menu.tsx
web/src/components/ui/dropdown-menu.tsx
+1
-1
en.json
web/src/locales/en.json
+3
-0
No files found.
web/src/components/MemoActionMenu.tsx
View file @
7079790d
...
...
@@ -6,6 +6,8 @@ import {
BookmarkPlusIcon
,
CopyIcon
,
Edit3Icon
,
FileTextIcon
,
LinkIcon
,
MoreVerticalIcon
,
TrashIcon
,
SquareCheckIcon
,
...
...
@@ -24,7 +26,15 @@ import { NodeType } from "@/types/proto/api/v1/markdown_service";
import
{
Memo
}
from
"@/types/proto/api/v1/memo_service"
;
import
{
useTranslate
}
from
"@/utils/i18n"
;
import
{
Button
}
from
"./ui/button"
;
import
{
DropdownMenu
,
DropdownMenuContent
,
DropdownMenuItem
,
DropdownMenuTrigger
}
from
"./ui/dropdown-menu"
;
import
{
DropdownMenu
,
DropdownMenuContent
,
DropdownMenuItem
,
DropdownMenuSub
,
DropdownMenuSubContent
,
DropdownMenuSubTrigger
,
DropdownMenuTrigger
,
}
from
"./ui/dropdown-menu"
;
interface
Props
{
memo
:
Memo
;
...
...
@@ -127,6 +137,11 @@ const MemoActionMenu = observer((props: Props) => {
toast
.
success
(
t
(
"message.succeed-copy-link"
));
};
const
handleCopyContent
=
()
=>
{
copy
(
memo
.
content
);
toast
.
success
(
t
(
"message.succeed-copy-content"
));
};
const
handleDeleteMemoClick
=
()
=>
{
setDeleteDialogOpen
(
true
);
};
...
...
@@ -196,10 +211,22 @@ const MemoActionMenu = observer((props: Props) => {
</>
)
}
{
!
isArchived
&&
(
<
DropdownMenuItem
onClick=
{
handleCopyLink
}
>
<
CopyIcon
className=
"w-4 h-auto"
/>
{
t
(
"memo.copy-link"
)
}
</
DropdownMenuItem
>
<
DropdownMenuSub
>
<
DropdownMenuSubTrigger
>
<
CopyIcon
className=
"w-4 h-auto"
/>
{
t
(
"common.copy"
)
}
</
DropdownMenuSubTrigger
>
<
DropdownMenuSubContent
>
<
DropdownMenuItem
onClick=
{
handleCopyLink
}
>
<
LinkIcon
className=
"w-4 h-auto"
/>
{
t
(
"memo.copy-link"
)
}
</
DropdownMenuItem
>
<
DropdownMenuItem
onClick=
{
handleCopyContent
}
>
<
FileTextIcon
className=
"w-4 h-auto"
/>
{
t
(
"memo.copy-content"
)
}
</
DropdownMenuItem
>
</
DropdownMenuSubContent
>
</
DropdownMenuSub
>
)
}
{
!
readonly
&&
(
<>
...
...
web/src/components/ui/dropdown-menu.tsx
View file @
7079790d
...
...
@@ -176,7 +176,7 @@ function DropdownMenuSubTrigger({
data
-
slot=
"dropdown-menu-sub-trigger"
data
-
inset=
{
inset
}
className=
{
cn
(
"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground
flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8
"
,
"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground
[&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4
"
,
className
,
)
}
{
...
props
}
...
...
web/src/locales/en.json
View file @
7079790d
...
...
@@ -31,6 +31,7 @@
"close"
:
"Close"
,
"collapse"
:
"Collapse"
,
"confirm"
:
"Confirm"
,
"copy"
:
"Copy"
,
"create"
:
"Create"
,
"created-at"
:
"Created At"
,
"database"
:
"Database"
,
...
...
@@ -141,6 +142,7 @@
"self"
:
"Comments"
,
"write-a-comment"
:
"Write a comment"
},
"copy-content"
:
"Copy Content"
,
"copy-link"
:
"Copy Link"
,
"count-memos-in-date"
:
"{{count}} {{memos}} in {{date}}"
,
"delete-confirm"
:
"Are you sure you want to delete this memo?"
,
...
...
@@ -188,6 +190,7 @@
"password-not-match"
:
"Passwords do not match."
,
"remove-completed-task-list-items-successfully"
:
"The removal was successful"
,
"restored-successfully"
:
"Restored successfully"
,
"succeed-copy-content"
:
"Content copied successfully."
,
"succeed-copy-link"
:
"Link copied successfully."
,
"update-succeed"
:
"Update succeeded"
,
"user-not-found"
:
"User not found"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment