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
0f48cfbb
Commit
0f48cfbb
authored
Mar 15, 2024
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: tweak padding styles
parent
606a3064
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
22 deletions
+22
-22
index.tsx
web/src/components/MemoContent/index.tsx
+12
-12
MemoReactionListView.tsx
web/src/components/MemoReactionListView.tsx
+1
-1
MemoRelationListView.tsx
web/src/components/MemoRelationListView.tsx
+2
-2
MemoResourceListView.tsx
web/src/components/MemoResourceListView.tsx
+4
-4
MemoView.tsx
web/src/components/MemoView.tsx
+3
-3
No files found.
web/src/components/MemoContent/index.tsx
View file @
0f48cfbb
...
...
@@ -69,7 +69,7 @@ const MemoContent: React.FC<Props> = (props: Props) => {
embeddedMemos
:
embeddedMemos
||
new
Set
(),
}
}
>
<
div
className=
{
`
mt-1
w-full flex flex-col justify-start items-start text-gray-800 dark:text-gray-300 ${className || ""}`
}
>
<
div
className=
{
`w-full flex flex-col justify-start items-start text-gray-800 dark:text-gray-300 ${className || ""}`
}
>
<
div
ref=
{
memoContentContainerRef
}
className=
{
classNames
(
...
...
@@ -89,19 +89,19 @@ const MemoContent: React.FC<Props> = (props: Props) => {
return
<
Renderer
key=
{
`${node.type}-${index}`
}
index=
{
String
(
index
)
}
node=
{
node
}
/>;
})
}
</
div
>
{
memo
&&
showCompactMode
&&
(
<
div
className=
"w-full mt-1"
>
<
div
className=
"w-auto inline-flex flex-row justify-start items-center cursor-pointer text-sm text-blue-600 dark:text-blue-400 hover:opacity-80"
onClick=
{
()
=>
setShowCompactMode
(
false
)
}
>
<
span
>
{
t
(
"memo.show-more"
)
}
</
span
>
<
Icon
.
ChevronRight
className=
"w-4 h-auto"
/>
</
div
>
</
div
>
)
}
</
div
>
</
RendererContext
.
Provider
>
{
memo
&&
showCompactMode
&&
(
<
div
className=
"w-full mt-2"
>
<
div
className=
"w-auto inline-flex flex-row justify-start items-center cursor-pointer text-sm text-blue-600 dark:text-blue-400 hover:opacity-80"
onClick=
{
()
=>
setShowCompactMode
(
false
)
}
>
<
span
>
{
t
(
"memo.show-more"
)
}
</
span
>
<
Icon
.
ChevronRight
className=
"w-4 h-auto"
/>
</
div
>
</
div
>
)
}
</>
);
};
...
...
web/src/components/MemoReactionListView.tsx
View file @
0f48cfbb
...
...
@@ -34,7 +34,7 @@ const MemoReactionListView = (props: Props) => {
return
(
reactions
.
length
>
0
&&
(
<
div
className=
"w-full
mt-2
flex flex-row justify-start items-start flex-wrap gap-1 select-none"
>
<
div
className=
"w-full flex flex-row justify-start items-start flex-wrap gap-1 select-none"
>
{
Array
.
from
(
reactionGroup
).
map
(([
reactionType
,
users
])
=>
{
return
<
ReactionView
key=
{
`${reactionType.toString()} ${users.length}`
}
memo=
{
memo
}
reactionType=
{
reactionType
}
users=
{
users
}
/>;
})
}
...
...
web/src/components/MemoRelationListView.tsx
View file @
0f48cfbb
...
...
@@ -37,7 +37,7 @@ const MemoRelationListView = (props: Props) => {
return
(
<>
{
referencingMemoList
.
length
>
0
&&
(
<
div
className=
"w-full
mt-2
flex flex-row justify-start items-center flex-wrap gap-2"
>
<
div
className=
"w-full flex flex-row justify-start items-center flex-wrap gap-2"
>
{
referencingMemoList
.
map
((
memo
)
=>
{
return
(
<
div
key=
{
memo
.
name
}
className=
"block w-auto max-w-[50%]"
>
...
...
@@ -57,7 +57,7 @@ const MemoRelationListView = (props: Props) => {
</
div
>
)
}
{
referencedMemoList
.
length
>
0
&&
(
<
div
className=
"w-full
mt-2
flex flex-row justify-start items-center flex-wrap gap-2"
>
<
div
className=
"w-full flex flex-row justify-start items-center flex-wrap gap-2"
>
{
referencedMemoList
.
map
((
memo
)
=>
{
return
(
<
div
key=
{
memo
.
name
}
className=
"block w-auto max-w-[50%]"
>
...
...
web/src/components/MemoResourceListView.tsx
View file @
0f48cfbb
...
...
@@ -62,7 +62,7 @@ const MemoResourceListView = ({ resources = [] }: { resources: Resource[] }) =>
if
(
resources
.
length
===
1
)
{
return
(
<
div
className=
"m
t-2 mb-1 m
ax-w-full flex justify-center items-center border dark:border-zinc-800 rounded overflow-hidden hide-scrollbar hover:shadow-md"
>
<
div
className=
"max-w-full flex justify-center items-center border dark:border-zinc-800 rounded overflow-hidden hide-scrollbar hover:shadow-md"
>
<
MediaCard
resource=
{
mediaResources
[
0
]
}
/>
</
div
>
);
...
...
@@ -78,17 +78,17 @@ const MemoResourceListView = ({ resources = [] }: { resources: Resource[] }) =>
));
if
(
resources
.
length
===
2
||
resources
.
length
===
4
)
{
return
<
div
className=
"w-full
mt-2 mb-1
grid gap-2 grid-cols-2"
>
{
cards
}
</
div
>;
return
<
div
className=
"w-full grid gap-2 grid-cols-2"
>
{
cards
}
</
div
>;
}
return
<
div
className=
"w-full
mt-2 mb-1
grid gap-2 grid-cols-2 sm:grid-cols-3"
>
{
cards
}
</
div
>;
return
<
div
className=
"w-full grid gap-2 grid-cols-2 sm:grid-cols-3"
>
{
cards
}
</
div
>;
};
const
OtherList
=
({
resources
=
[]
}:
{
resources
:
Resource
[]
})
=>
{
if
(
resources
.
length
===
0
)
return
<></>;
return
(
<
div
className=
"w-full flex flex-row justify-start flex-wrap
mt-2 mb-1
gap-2"
>
<
div
className=
"w-full flex flex-row justify-start flex-wrap gap-2"
>
{
otherResources
.
map
((
resource
)
=>
(
<
MemoResource
key=
{
resource
.
id
}
resource=
{
resource
}
/>
))
}
...
...
web/src/components/MemoView.tsx
View file @
0f48cfbb
...
...
@@ -76,14 +76,14 @@ const MemoView: React.FC<Props> = (props: Props) => {
return
(
<
div
className=
{
classNames
(
"group relative flex flex-col justify-start items-start w-full px-4 pt-4 pb-3
mb
-2 bg-white dark:bg-zinc-800 rounded-lg border border-white dark:border-zinc-800 hover:border-gray-200 dark:hover:border-zinc-700"
,
"group relative flex flex-col justify-start items-start w-full px-4 pt-4 pb-3
mb-2 gap
-2 bg-white dark:bg-zinc-800 rounded-lg border border-white dark:border-zinc-800 hover:border-gray-200 dark:hover:border-zinc-700"
,
"memos-"
+
memo
.
id
,
memo
.
pinned
&&
props
.
showPinned
&&
"border-gray-200 border dark:border-zinc-700"
,
className
,
)
}
ref=
{
memoContainerRef
}
>
<
div
className=
"w-full h-7 flex flex-row justify-between items-center
mb-2
gap-2"
>
<
div
className=
"w-full h-7 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"
>
{
creator
&&
(
<
div
className=
"w-full flex flex-row justify-start items-center"
>
...
...
@@ -151,7 +151,7 @@ const MemoView: React.FC<Props> = (props: Props) => {
/>
<
MemoResourceListView
resources=
{
memo
.
resources
}
/>
<
div
className=
"w-full flex flex-row justify-between items-center"
>
<
div
className=
"text-sm leading-
6
text-gray-400 select-none"
>
<
div
className=
"text-sm leading-
none
text-gray-400 select-none"
>
<
relative
-
time
datetime=
{
memo
.
displayTime
?.
toISOString
()
}
tense=
"past"
onClick=
{
handleGotoMemoDetailPage
}
></
relative
-
time
>
</
div
>
</
div
>
...
...
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