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
f5d5ebea
Commit
f5d5ebea
authored
Apr 06, 2025
by
Johnny
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: hide actions for comment
parent
aa8cf44c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
MemoActionMenu.tsx
web/src/components/MemoActionMenu.tsx
+10
-7
No files found.
web/src/components/MemoActionMenu.tsx
View file @
f5d5ebea
...
@@ -49,9 +49,10 @@ const MemoActionMenu = (props: Props) => {
...
@@ -49,9 +49,10 @@ const MemoActionMenu = (props: Props) => {
const
location
=
useLocation
();
const
location
=
useLocation
();
const
navigateTo
=
useNavigateTo
();
const
navigateTo
=
useNavigateTo
();
const
memoStore
=
useMemoStore
();
const
memoStore
=
useMemoStore
();
const
isArchived
=
memo
.
state
===
State
.
ARCHIVED
;
const
hasCompletedTaskList
=
checkHasCompletedTaskList
(
memo
);
const
hasCompletedTaskList
=
checkHasCompletedTaskList
(
memo
);
const
isInMemoDetailPage
=
location
.
pathname
.
startsWith
(
`/
${
memo
.
name
}
`
);
const
isInMemoDetailPage
=
location
.
pathname
.
startsWith
(
`/
${
memo
.
name
}
`
);
const
isComment
=
Boolean
(
memo
.
parent
);
const
isArchived
=
memo
.
state
===
State
.
ARCHIVED
;
const
memoUpdatedCallback
=
()
=>
{
const
memoUpdatedCallback
=
()
=>
{
// Refresh user stats.
// Refresh user stats.
...
@@ -170,7 +171,7 @@ const MemoActionMenu = (props: Props) => {
...
@@ -170,7 +171,7 @@ const MemoActionMenu = (props: Props) => {
</
span
>
</
span
>
</
MenuButton
>
</
MenuButton
>
<
Menu
className=
"text-sm"
size=
"sm"
placement=
"bottom-end"
>
<
Menu
className=
"text-sm"
size=
"sm"
placement=
"bottom-end"
>
{
!
readonly
&&
!
isArchived
&&
(
{
!
readonly
&&
!
isArchived
&&
!
isComment
&&
(
<>
<>
<
MenuItem
onClick=
{
handleTogglePinMemoBtnClick
}
>
<
MenuItem
onClick=
{
handleTogglePinMemoBtnClick
}
>
{
memo
.
pinned
?
<
BookmarkMinusIcon
className=
"w-4 h-auto"
/>
:
<
BookmarkPlusIcon
className=
"w-4 h-auto"
/>
}
{
memo
.
pinned
?
<
BookmarkMinusIcon
className=
"w-4 h-auto"
/>
:
<
BookmarkPlusIcon
className=
"w-4 h-auto"
/>
}
...
@@ -190,16 +191,18 @@ const MemoActionMenu = (props: Props) => {
...
@@ -190,16 +191,18 @@ const MemoActionMenu = (props: Props) => {
)
}
)
}
{
!
readonly
&&
(
{
!
readonly
&&
(
<>
<>
{
!
isArchived
&&
hasCompletedTaskList
&&
(
{
!
isArchived
&&
!
isComment
&&
hasCompletedTaskList
&&
(
<
MenuItem
color=
"warning"
onClick=
{
handleRemoveCompletedTaskListItemsClick
}
>
<
MenuItem
color=
"warning"
onClick=
{
handleRemoveCompletedTaskListItemsClick
}
>
<
SquareCheckIcon
className=
"w-4 h-auto"
/>
<
SquareCheckIcon
className=
"w-4 h-auto"
/>
{
t
(
"memo.remove-completed-task-list-items"
)
}
{
t
(
"memo.remove-completed-task-list-items"
)
}
</
MenuItem
>
</
MenuItem
>
)
}
)
}
<
MenuItem
color=
"warning"
onClick=
{
handleToggleMemoStatusClick
}
>
{
!
isComment
&&
(
{
isArchived
?
<
ArchiveRestoreIcon
className=
"w-4 h-auto"
/>
:
<
ArchiveIcon
className=
"w-4 h-auto"
/>
}
<
MenuItem
color=
"warning"
onClick=
{
handleToggleMemoStatusClick
}
>
{
isArchived
?
t
(
"common.restore"
)
:
t
(
"common.archive"
)
}
{
isArchived
?
<
ArchiveRestoreIcon
className=
"w-4 h-auto"
/>
:
<
ArchiveIcon
className=
"w-4 h-auto"
/>
}
</
MenuItem
>
{
isArchived
?
t
(
"common.restore"
)
:
t
(
"common.archive"
)
}
</
MenuItem
>
)
}
<
MenuItem
color=
"danger"
onClick=
{
handleDeleteMemoClick
}
>
<
MenuItem
color=
"danger"
onClick=
{
handleDeleteMemoClick
}
>
<
TrashIcon
className=
"w-4 h-auto"
/>
<
TrashIcon
className=
"w-4 h-auto"
/>
{
t
(
"common.delete"
)
}
{
t
(
"common.delete"
)
}
...
...
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