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
fc958766
Commit
fc958766
authored
Apr 09, 2024
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: update memo creator display
parent
b1e196bb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
3 deletions
+9
-3
MemoView.tsx
web/src/components/MemoView.tsx
+6
-1
Explore.tsx
web/src/pages/Explore.tsx
+1
-1
MemoDetail.tsx
web/src/pages/MemoDetail.tsx
+2
-1
No files found.
web/src/components/MemoView.tsx
View file @
fc958766
...
@@ -24,6 +24,7 @@ import VisibilityIcon from "./VisibilityIcon";
...
@@ -24,6 +24,7 @@ import VisibilityIcon from "./VisibilityIcon";
interface
Props
{
interface
Props
{
memo
:
Memo
;
memo
:
Memo
;
compact
?:
boolean
;
compact
?:
boolean
;
showCreator
?:
boolean
;
showVisibility
?:
boolean
;
showVisibility
?:
boolean
;
showPinned
?:
boolean
;
showPinned
?:
boolean
;
className
?:
string
;
className
?:
string
;
...
@@ -85,7 +86,7 @@ const MemoView: React.FC<Props> = (props: Props) => {
...
@@ -85,7 +86,7 @@ const MemoView: React.FC<Props> = (props: Props) => {
>
>
<
div
className=
"w-full flex flex-row justify-between items-center gap-2"
>
<
div
className=
"w-full flex flex-row justify-between items-center gap-2"
>
<
div
className=
"w-auto max-w-[calc(100%-8rem)] grow flex flex-row justify-start items-center"
>
<
div
className=
"w-auto max-w-[calc(100%-8rem)] grow flex flex-row justify-start items-center"
>
{
creator
&&
(
{
props
.
showCreator
&&
creator
?
(
<
div
className=
"w-full flex flex-row justify-start items-center"
>
<
div
className=
"w-full flex flex-row justify-start items-center"
>
<
Link
className=
"w-auto hover:opacity-80"
to=
{
`/u/${encodeURIComponent(creator.username)}`
}
unstable_viewTransition
>
<
Link
className=
"w-auto hover:opacity-80"
to=
{
`/u/${encodeURIComponent(creator.username)}`
}
unstable_viewTransition
>
<
UserAvatar
className=
"mr-2 shrink-0"
avatarUrl=
{
creator
.
avatarUrl
}
/>
<
UserAvatar
className=
"mr-2 shrink-0"
avatarUrl=
{
creator
.
avatarUrl
}
/>
...
@@ -106,6 +107,10 @@ const MemoView: React.FC<Props> = (props: Props) => {
...
@@ -106,6 +107,10 @@ const MemoView: React.FC<Props> = (props: Props) => {
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
)
:
(
<
div
className=
"w-full text-sm leading-tight text-gray-400 dark:text-gray-500 select-none"
onClick=
{
handleGotoMemoDetailPage
}
>
<
relative
-
time
datetime=
{
memo
.
displayTime
?.
toISOString
()
}
format=
{
relativeTimeFormat
}
tense=
"past"
></
relative
-
time
>
</
div
>
)
}
)
}
</
div
>
</
div
>
<
div
className=
"flex flex-row justify-end items-center select-none shrink-0 gap-2"
>
<
div
className=
"flex flex-row justify-end items-center select-none shrink-0 gap-2"
>
...
...
web/src/pages/Explore.tsx
View file @
fc958766
...
@@ -66,7 +66,7 @@ const Explore = () => {
...
@@ -66,7 +66,7 @@ const Explore = () => {
<
div
className=
"flex flex-col justify-start items-start w-full max-w-full"
>
<
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.name}-${memo.updateTime}`
}
memo=
{
memo
}
showVisibility
showPinned
/>
<
MemoView
key=
{
`${memo.name}-${memo.updateTime}`
}
memo=
{
memo
}
show
Creator
show
Visibility
showPinned
/>
))
}
))
}
{
isRequesting
?
(
{
isRequesting
?
(
<
div
className=
"flex flex-row justify-center items-center w-full my-4 text-gray-400"
>
<
div
className=
"flex flex-row justify-center items-center w-full my-4 text-gray-400"
>
...
...
web/src/pages/MemoDetail.tsx
View file @
fc958766
...
@@ -86,6 +86,7 @@ const MemoDetail = () => {
...
@@ -86,6 +86,7 @@ const MemoDetail = () => {
className=
"shadow hover:shadow-xl transition-all"
className=
"shadow hover:shadow-xl transition-all"
memo=
{
memo
}
memo=
{
memo
}
compact=
{
false
}
compact=
{
false
}
showCreator
showVisibility
showVisibility
showPinned
showPinned
/>
/>
...
@@ -107,7 +108,7 @@ const MemoDetail = () => {
...
@@ -107,7 +108,7 @@ const MemoDetail = () => {
<
span
className=
"text-gray-400 text-sm ml-0.5"
>
(
{
comments
.
length
}
)
</
span
>
<
span
className=
"text-gray-400 text-sm ml-0.5"
>
(
{
comments
.
length
}
)
</
span
>
</
div
>
</
div
>
{
comments
.
map
((
comment
)
=>
(
{
comments
.
map
((
comment
)
=>
(
<
MemoView
key=
{
`${memo.name}-${memo.displayTime}`
}
memo=
{
comment
}
/>
<
MemoView
key=
{
`${memo.name}-${memo.displayTime}`
}
memo=
{
comment
}
showCreator
/>
))
}
))
}
</>
</>
)
}
)
}
...
...
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