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
fa34a7af
Commit
fa34a7af
authored
Dec 09, 2023
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: tweak memo parent styles
parent
77b75aa6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
11 deletions
+24
-11
Memo.tsx
web/src/components/Memo.tsx
+22
-9
MemoList.tsx
web/src/components/MemoList.tsx
+1
-1
Explore.tsx
web/src/pages/Explore.tsx
+1
-1
No files found.
web/src/components/Memo.tsx
View file @
fa34a7af
...
...
@@ -26,6 +26,7 @@ import "@/less/memo.less";
interface
Props
{
memo
:
Memo
;
showCreator
?:
boolean
;
showParent
?:
boolean
;
showVisibility
?:
boolean
;
showPinnedStyle
?:
boolean
;
lazyRendering
?:
boolean
;
...
...
@@ -228,7 +229,7 @@ const Memo: React.FC<Props> = (props: Props) => {
>
<
div
className=
"memo-top-wrapper"
>
<
div
className=
"w-full max-w-[calc(100%-20px)] flex flex-row justify-start items-center mr-1"
>
{
props
.
showCreator
&&
(
{
props
.
showCreator
&&
creator
&&
(
<>
<
Link
to=
{
`/u/${encodeURIComponent(memo.creatorUsername)}`
}
>
<
Tooltip
title=
{
"Creator"
}
placement=
"top"
>
...
...
@@ -246,6 +247,14 @@ const Memo: React.FC<Props> = (props: Props) => {
<
span
className=
"text-sm text-gray-400 select-none"
onClick=
{
handleGotoMemoDetailPage
}
>
{
displayTime
}
</
span
>
{
props
.
showPinnedStyle
&&
memo
.
pinned
&&
(
<>
<
Icon
.
Dot
className=
"w-4 h-auto text-gray-400 dark:text-zinc-400"
/>
<
Tooltip
title=
{
"Pinned"
}
placement=
"top"
>
<
Icon
.
Bookmark
className=
"w-4 h-auto text-green-600"
/>
</
Tooltip
>
</>
)
}
<
div
className=
"w-auto hidden group-hover:flex flex-row justify-between items-center"
>
<
Icon
.
Dot
className=
"w-4 h-auto text-gray-400 dark:text-zinc-400"
/>
<
Link
className=
"flex flex-row justify-start items-center"
to=
{
`/m/${memo.id}`
}
>
...
...
@@ -253,14 +262,6 @@ const Memo: React.FC<Props> = (props: Props) => {
<
span
className=
"text-sm text-gray-500 dark:text-gray-400"
>
#
{
memo
.
id
}
</
span
>
</
Tooltip
>
</
Link
>
{
memo
.
pinned
&&
props
.
showPinnedStyle
&&
(
<>
<
Icon
.
Dot
className=
"w-4 h-auto text-gray-400 dark:text-zinc-400"
/>
<
Tooltip
title=
{
"Pinned"
}
placement=
"top"
>
<
Icon
.
Bookmark
className=
"w-4 h-auto text-green-600"
/>
</
Tooltip
>
</>
)
}
{
props
.
showVisibility
&&
memo
.
visibility
!==
"PRIVATE"
&&
(
<>
<
Icon
.
Dot
className=
"w-4 h-auto text-gray-400 dark:text-zinc-400"
/>
...
...
@@ -316,6 +317,18 @@ const Memo: React.FC<Props> = (props: Props) => {
)
}
</
div
>
</
div
>
{
props
.
showParent
&&
memo
.
parent
&&
(
<
div
className=
"w-auto max-w-full mt-1"
>
<
Link
className=
"px-2 py-0.5 border rounded-full max-w-xs w-auto text-xs flex flex-row justify-start items-center flex-nowrap text-gray-600 dark:text-gray-400 dark:border-gray-500 hover:shadow hover:opacity-80"
to=
{
`/m/${memo.parent.id}`
}
>
<
Icon
.
ArrowUpRightFromCircle
className=
"w-3 h-auto shrink-0 opacity-60"
/>
<
span
className=
"mx-1 opacity-60"
>
#
{
memo
.
parent
.
id
}
</
span
>
<
span
className=
"truncate"
>
{
memo
.
parent
.
content
}
</
span
>
</
Link
>
</
div
>
)
}
<
MemoContent
content=
{
memo
.
content
}
onMemoContentClick=
{
handleMemoContentClick
}
...
...
web/src/components/MemoList.tsx
View file @
fa34a7af
...
...
@@ -111,7 +111,7 @@ const MemoList: React.FC = () => {
<
div
className=
"flex flex-col justify-start items-start w-full max-w-full overflow-y-scroll pb-28 hide-scrollbar"
>
<
MemoFilter
/>
{
sortedMemos
.
map
((
memo
)
=>
(
<
Memo
key=
{
memo
.
id
}
memo=
{
memo
}
lazyRendering
showVisibility
showPinnedStyle
/>
<
Memo
key=
{
memo
.
id
}
memo=
{
memo
}
lazyRendering
showVisibility
showPinnedStyle
showParent
/>
))
}
{
loadingStatus
===
"fetching"
?
(
...
...
web/src/pages/Explore.tsx
View file @
fa34a7af
...
...
@@ -83,7 +83,7 @@ const Explore = () => {
<
div
className=
"relative w-full h-auto flex flex-col justify-start items-start"
>
<
MemoFilter
/>
{
sortedMemos
.
map
((
memo
)
=>
(
<
Memo
key=
{
memo
.
id
}
memo=
{
memo
}
lazyRendering
showCreator
/>
<
Memo
key=
{
memo
.
id
}
memo=
{
memo
}
lazyRendering
showCreator
showParent
/>
))
}
{
loadingStatus
===
"fetching"
?
(
...
...
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