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
f1ec5775
Commit
f1ec5775
authored
Feb 14, 2024
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: update inbox props
parent
4aa4417d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
28 deletions
+31
-28
DisablePasswordLoginDialog.tsx
web/src/components/DisablePasswordLoginDialog.tsx
+5
-5
MemoCommentMessage.tsx
web/src/components/Inbox/MemoCommentMessage.tsx
+17
-17
VersionUpdateMessage.tsx
web/src/components/Inbox/VersionUpdateMessage.tsx
+8
-5
Home.tsx
web/src/pages/Home.tsx
+1
-1
No files found.
web/src/components/DisablePasswordLoginDialog.tsx
View file @
f1ec5775
...
@@ -57,20 +57,20 @@ const DisablePasswordLoginDialog: React.FC<Props> = ({ destroy }: Props) => {
...
@@ -57,20 +57,20 @@ const DisablePasswordLoginDialog: React.FC<Props> = ({ destroy }: Props) => {
return
(
return
(
<>
<>
<
div
className=
"dialog-header-container
!w-64
"
>
<
div
className=
"dialog-header-container"
>
<
p
className=
"title-text"
>
{
t
(
"setting.system-section.disable-password-login"
)
}
</
p
>
<
p
className=
"title-text"
>
{
t
(
"setting.system-section.disable-password-login"
)
}
</
p
>
<
IconButton
size=
"sm"
onClick=
{
handleCloseBtnClick
}
>
<
IconButton
size=
"sm"
onClick=
{
handleCloseBtnClick
}
>
<
Icon
.
X
className=
"w-5 h-auto"
/>
<
Icon
.
X
className=
"w-5 h-auto"
/>
</
IconButton
>
</
IconButton
>
</
div
>
</
div
>
<
div
className=
"dialog-content-container !w-
64
"
>
<
div
className=
"dialog-content-container !w-
72
"
>
{
confirmedOnce
?
(
{
confirmedOnce
?
(
<>
<>
<
p
className=
"
content-text
"
>
{
t
(
"setting.system-section.disable-password-login-final-warning"
)
}
</
p
>
<
p
className=
""
>
{
t
(
"setting.system-section.disable-password-login-final-warning"
)
}
</
p
>
<
Input
value=
{
typingConfirmation
}
onChange=
{
handleTypingConfirmationChanged
}
/>
<
Input
className=
"w-full mt-2"
value=
{
typingConfirmation
}
onChange=
{
handleTypingConfirmationChanged
}
/>
</>
</>
)
:
(
)
:
(
<
p
className=
"
content-text
"
>
{
t
(
"setting.system-section.disable-password-login-warning"
)
}
</
p
>
<
p
className=
""
>
{
t
(
"setting.system-section.disable-password-login-warning"
)
}
</
p
>
)
}
)
}
<
div
className=
"mt-4 w-full flex flex-row justify-end items-center space-x-2"
>
<
div
className=
"mt-4 w-full flex flex-row justify-end items-center space-x-2"
>
<
Button
variant=
"plain"
color=
"neutral"
onClick=
{
handleCloseBtnClick
}
>
<
Button
variant=
"plain"
color=
"neutral"
onClick=
{
handleCloseBtnClick
}
>
...
...
web/src/components/Inbox/MemoCommentMessage.tsx
View file @
f1ec5775
...
@@ -5,8 +5,8 @@ import toast from "react-hot-toast";
...
@@ -5,8 +5,8 @@ import toast from "react-hot-toast";
import
{
activityServiceClient
}
from
"@/grpcweb"
;
import
{
activityServiceClient
}
from
"@/grpcweb"
;
import
useNavigateTo
from
"@/hooks/useNavigateTo"
;
import
useNavigateTo
from
"@/hooks/useNavigateTo"
;
import
{
useInboxStore
,
extractUsernameFromName
,
useMemoStore
}
from
"@/store/v1"
;
import
{
useInboxStore
,
extractUsernameFromName
,
useMemoStore
}
from
"@/store/v1"
;
import
{
Activity
}
from
"@/types/proto/api/v2/activity_service"
;
import
{
Inbox
,
Inbox_Status
}
from
"@/types/proto/api/v2/inbox_service"
;
import
{
Inbox
,
Inbox_Status
}
from
"@/types/proto/api/v2/inbox_service"
;
import
{
Memo
}
from
"@/types/proto/api/v2/memo_service"
;
import
{
useTranslate
}
from
"@/utils/i18n"
;
import
{
useTranslate
}
from
"@/utils/i18n"
;
import
Icon
from
"../Icon"
;
import
Icon
from
"../Icon"
;
...
@@ -19,35 +19,35 @@ const MemoCommentMessage = ({ inbox }: Props) => {
...
@@ -19,35 +19,35 @@ const MemoCommentMessage = ({ inbox }: Props) => {
const
navigateTo
=
useNavigateTo
();
const
navigateTo
=
useNavigateTo
();
const
inboxStore
=
useInboxStore
();
const
inboxStore
=
useInboxStore
();
const
memoStore
=
useMemoStore
();
const
memoStore
=
useMemoStore
();
const
[
activity
,
setActivity
]
=
useState
<
Activity
|
undefined
>
(
undefined
);
const
[
relatedMemo
,
setRelatedMemo
]
=
useState
<
Memo
|
undefined
>
(
undefined
);
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
!
inbox
.
activityId
)
{
if
(
!
inbox
.
activityId
)
{
return
;
return
;
}
}
activityServiceClient
(
async
()
=>
{
.
getActivity
({
const
{
activity
}
=
await
activityServiceClient
.
getActivity
({
id
:
inbox
.
activityId
,
id
:
inbox
.
activityId
,
})
.
then
(({
activity
})
=>
{
setActivity
(
activity
);
});
});
if
(
!
activity
)
{
return
;
}
if
(
activity
.
payload
?.
memoComment
?.
relatedMemoId
)
{
const
memo
=
await
memoStore
.
getOrFetchMemoById
(
activity
.
payload
?.
memoComment
?.
relatedMemoId
,
{
skipStore
:
true
,
});
setRelatedMemo
(
memo
);
}
})();
},
[
inbox
.
activityId
]);
},
[
inbox
.
activityId
]);
const
handleNavigateToMemo
=
async
()
=>
{
const
handleNavigateToMemo
=
async
()
=>
{
const
relatedMemoId
=
activity
?.
payload
?.
memoComment
?.
relatedMemoId
;
if
(
!
relatedMemo
)
{
if
(
!
relatedMemoId
)
{
return
;
return
;
}
}
const
memo
=
await
memoStore
.
getOrFetchMemoById
(
relatedMemoId
);
navigateTo
(
`/m/
${
relatedMemo
.
name
}
`
);
if
(
!
memo
)
{
toast
.
error
(
"Memo not found"
);
return
;
}
navigateTo
(
`/m/
${
memo
.
name
}
`
);
if
(
inbox
.
status
===
Inbox_Status
.
UNREAD
)
{
if
(
inbox
.
status
===
Inbox_Status
.
UNREAD
)
{
handleArchiveMessage
(
true
);
handleArchiveMessage
(
true
);
}
}
...
@@ -105,7 +105,7 @@ const MemoCommentMessage = ({ inbox }: Props) => {
...
@@ -105,7 +105,7 @@ const MemoCommentMessage = ({ inbox }: Props) => {
>
>
{
t
(
"inbox.memo-comment"
,
{
{
t
(
"inbox.memo-comment"
,
{
user
:
extractUsernameFromName
(
inbox
.
sender
),
user
:
extractUsernameFromName
(
inbox
.
sender
),
memo
:
`memo
#${activity?.payload?.memoComment?.relatedMemoId
}`
,
memo
:
`memo
s#${relatedMemo?.name
}`
,
})
}
})
}
</
p
>
</
p
>
</
div
>
</
div
>
...
...
web/src/components/Inbox/VersionUpdateMessage.tsx
View file @
f1ec5775
...
@@ -23,13 +23,16 @@ const VersionUpdateMessage = ({ inbox }: Props) => {
...
@@ -23,13 +23,16 @@ const VersionUpdateMessage = ({ inbox }: Props) => {
return
;
return
;
}
}
activityServiceClient
(
async
()
=>
{
.
getActivity
({
const
{
activity
}
=
await
activityServiceClient
.
getActivity
({
id
:
inbox
.
activityId
,
id
:
inbox
.
activityId
,
})
.
then
(({
activity
})
=>
{
setActivity
(
activity
);
});
});
if
(
!
activity
)
{
return
;
}
setActivity
(
activity
);
})();
},
[
inbox
.
activityId
]);
},
[
inbox
.
activityId
]);
const
handleNavigate
=
()
=>
{
const
handleNavigate
=
()
=>
{
...
...
web/src/pages/Home.tsx
View file @
f1ec5775
...
@@ -70,7 +70,7 @@ const Home = () => {
...
@@ -70,7 +70,7 @@ const Home = () => {
<
div
className=
{
classNames
(
"w-full flex flex-row justify-start items-start px-4 sm:px-6 gap-4"
)
}
>
<
div
className=
{
classNames
(
"w-full flex flex-row justify-start items-start px-4 sm:px-6 gap-4"
)
}
>
<
div
className=
{
classNames
(
md
?
"w-[calc(100%-15rem)]"
:
"w-full"
)
}
>
<
div
className=
{
classNames
(
md
?
"w-[calc(100%-15rem)]"
:
"w-full"
)
}
>
<
MemoEditor
className=
"mb-2"
cacheKey=
"home-memo-editor"
/>
<
MemoEditor
className=
"mb-2"
cacheKey=
"home-memo-editor"
/>
<
div
className=
"flex flex-col justify-start items-start w-full max-w-full
pb-28
"
>
<
div
className=
"flex flex-col justify-start items-start w-full max-w-full"
>
<
MemoFilter
className=
"px-2 pb-2"
/>
<
MemoFilter
className=
"px-2 pb-2"
/>
{
sortedMemos
.
map
((
memo
)
=>
(
{
sortedMemos
.
map
((
memo
)
=>
(
<
MemoView
key=
{
`${memo.id}-${memo.updateTime}`
}
memo=
{
memo
}
showVisibility
showPinned
/>
<
MemoView
key=
{
`${memo.id}-${memo.updateTime}`
}
memo=
{
memo
}
showVisibility
showPinned
/>
...
...
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