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
fae0b4e9
Commit
fae0b4e9
authored
Jan 21, 2024
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: update memo relation style
parent
c38404b5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
20 deletions
+16
-20
CreateMemoRelationDialog.tsx
web/src/components/CreateMemoRelationDialog.tsx
+4
-5
RelationListView.tsx
web/src/components/MemoEditor/RelationListView.tsx
+2
-3
MemoRelationListView.tsx
web/src/components/MemoRelationListView.tsx
+5
-7
MemoView.tsx
web/src/components/MemoView.tsx
+5
-5
No files found.
web/src/components/CreateMemoRelationDialog.tsx
View file @
fae0b4e9
...
@@ -96,13 +96,12 @@ const CreateMemoRelationDialog: React.FC<Props> = (props: Props) => {
...
@@ -96,13 +96,12 @@ const CreateMemoRelationDialog: React.FC<Props> = (props: Props) => {
<
div
className=
"w-full flex flex-row justify-start items-start flex-wrap gap-2 mt-1"
>
<
div
className=
"w-full flex flex-row justify-start items-start flex-wrap gap-2 mt-1"
>
{
memoList
.
map
((
memo
)
=>
(
{
memoList
.
map
((
memo
)
=>
(
<
div
<
div
className=
"max-w-[50%] text-sm px-
3 py-1 flex flex-row justify-start items-center border rounded-md cursor-pointer truncate opacity-80 dark:text-gray-300 dark:border-zinc-7
00 hover:opacity-60 hover:line-through"
className=
"max-w-[50%] text-sm px-
2 py-1 flex flex-row justify-start items-center border rounded-md cursor-pointer truncate opacity-80 text-gray-600 dark:text-gray-400 dark:border-zinc-700 dark:bg-zinc-9
00 hover:opacity-60 hover:line-through"
key=
{
memo
.
id
}
key=
{
memo
.
name
}
onClick=
{
()
=>
handleDeleteMemoRelation
(
memo
)
}
onClick=
{
()
=>
handleDeleteMemoRelation
(
memo
)
}
>
>
<
span
className=
"opacity-60 shrink-0"
>
#
{
memo
.
id
}
</
span
>
<
span
className=
"max-w-full text-ellipsis whitespace-nowrap overflow-hidden"
>
{
memo
.
content
}
</
span
>
<
span
className=
"mx-1 max-w-full text-ellipsis whitespace-nowrap overflow-hidden"
>
{
memo
.
content
}
</
span
>
<
Icon
.
X
className=
"opacity-60 w-4 h-auto shrink-0 ml-1"
/>
<
Icon
.
X
className=
"opacity-80 w-4 h-auto shrink-0 ml-1"
/>
</
div
>
</
div
>
))
}
))
}
</
div
>
</
div
>
...
...
web/src/components/MemoEditor/RelationListView.tsx
View file @
fae0b4e9
...
@@ -37,13 +37,12 @@ const RelationListView = (props: Props) => {
...
@@ -37,13 +37,12 @@ const RelationListView = (props: Props) => {
{
referencingMemoList
.
map
((
memo
)
=>
{
{
referencingMemoList
.
map
((
memo
)
=>
{
return
(
return
(
<
div
<
div
key=
{
memo
.
id
}
key=
{
memo
.
name
}
className=
"w-auto max-w-xs overflow-hidden flex flex-row justify-start items-center bg-zinc-100 dark:bg-zinc-900 hover:opacity-80 rounded-md text-sm p-1 px-2 text-gray-500 dark:text-gray-400 cursor-pointer hover:line-through"
className=
"w-auto max-w-xs overflow-hidden flex flex-row justify-start items-center bg-zinc-100 dark:bg-zinc-900 hover:opacity-80 rounded-md text-sm p-1 px-2 text-gray-500 dark:text-gray-400 cursor-pointer hover:line-through"
onClick=
{
()
=>
handleDeleteRelation
(
memo
)
}
onClick=
{
()
=>
handleDeleteRelation
(
memo
)
}
>
>
<
Icon
.
Link
className=
"w-4 h-auto shrink-0 opacity-80"
/>
<
Icon
.
Link
className=
"w-4 h-auto shrink-0 opacity-80"
/>
<
span
className=
"px-1 shrink-0 opacity-80"
>
#
{
memo
.
id
}
</
span
>
<
span
className=
"mx-1 max-w-full text-ellipsis whitespace-nowrap overflow-hidden"
>
{
memo
.
content
}
</
span
>
<
span
className=
"max-w-full text-ellipsis whitespace-nowrap overflow-hidden"
>
{
memo
.
content
}
</
span
>
<
Icon
.
X
className=
"w-4 h-auto cursor-pointer opacity-60 hover:opacity-100"
/>
<
Icon
.
X
className=
"w-4 h-auto cursor-pointer opacity-60 hover:opacity-100"
/>
</
div
>
</
div
>
);
);
...
...
web/src/components/MemoRelationListView.tsx
View file @
fae0b4e9
...
@@ -40,7 +40,7 @@ const MemoRelationListView = (props: Props) => {
...
@@ -40,7 +40,7 @@ const MemoRelationListView = (props: Props) => {
<
div
className=
"w-full mt-2 flex flex-row justify-start items-center flex-wrap gap-2"
>
<
div
className=
"w-full mt-2 flex flex-row justify-start items-center flex-wrap gap-2"
>
{
referencingMemoList
.
map
((
memo
)
=>
{
{
referencingMemoList
.
map
((
memo
)
=>
{
return
(
return
(
<
div
key=
{
memo
.
id
}
className=
"block w-auto max-w-[50%]"
>
<
div
key=
{
memo
.
name
}
className=
"block w-auto max-w-[50%]"
>
<
Link
<
Link
className=
"px-2 border rounded-md w-auto text-sm leading-6 flex flex-row justify-start items-center flex-nowrap text-gray-600 dark:text-gray-400 dark:border-zinc-700 dark:bg-zinc-900 hover:shadow hover:opacity-80"
className=
"px-2 border rounded-md w-auto text-sm leading-6 flex flex-row justify-start items-center flex-nowrap text-gray-600 dark:text-gray-400 dark:border-zinc-700 dark:bg-zinc-900 hover:shadow hover:opacity-80"
to=
{
`/m/${memo.name}`
}
to=
{
`/m/${memo.name}`
}
...
@@ -49,8 +49,7 @@ const MemoRelationListView = (props: Props) => {
...
@@ -49,8 +49,7 @@ const MemoRelationListView = (props: Props) => {
<
Tooltip
title=
"Reference"
placement=
"top"
>
<
Tooltip
title=
"Reference"
placement=
"top"
>
<
Icon
.
Link
className=
"w-4 h-auto shrink-0 opacity-70"
/>
<
Icon
.
Link
className=
"w-4 h-auto shrink-0 opacity-70"
/>
</
Tooltip
>
</
Tooltip
>
<
span
className=
"opacity-70 mx-1"
>
#
{
memo
.
id
}
</
span
>
<
span
className=
"truncate ml-1"
>
{
memo
.
content
}
</
span
>
<
span
className=
"truncate"
>
{
memo
.
content
}
</
span
>
</
Link
>
</
Link
>
</
div
>
</
div
>
);
);
...
@@ -61,17 +60,16 @@ const MemoRelationListView = (props: Props) => {
...
@@ -61,17 +60,16 @@ const MemoRelationListView = (props: Props) => {
<
div
className=
"w-full mt-2 flex flex-row justify-start items-center flex-wrap gap-2"
>
<
div
className=
"w-full mt-2 flex flex-row justify-start items-center flex-wrap gap-2"
>
{
referencedMemoList
.
map
((
memo
)
=>
{
{
referencedMemoList
.
map
((
memo
)
=>
{
return
(
return
(
<
div
key=
{
memo
.
id
}
className=
"block w-auto max-w-[50%]"
>
<
div
key=
{
memo
.
name
}
className=
"block w-auto max-w-[50%]"
>
<
Link
<
Link
className=
"px-2 border rounded-md w-auto text-sm leading-6 flex flex-row justify-start items-center flex-nowrap text-gray-600 dark:text-gray-
300 dark:border-gray-6
00 hover:shadow hover:opacity-80"
className=
"px-2 border rounded-md w-auto text-sm leading-6 flex flex-row justify-start items-center flex-nowrap text-gray-600 dark:text-gray-
400 dark:border-zinc-700 dark:bg-zinc-9
00 hover:shadow hover:opacity-80"
to=
{
`/m/${memo.name}`
}
to=
{
`/m/${memo.name}`
}
unstable_viewTransition
unstable_viewTransition
>
>
<
Tooltip
title=
"Backlink"
placement=
"top"
>
<
Tooltip
title=
"Backlink"
placement=
"top"
>
<
Icon
.
Milestone
className=
"w-4 h-auto shrink-0 opacity-70"
/>
<
Icon
.
Milestone
className=
"w-4 h-auto shrink-0 opacity-70"
/>
</
Tooltip
>
</
Tooltip
>
<
span
className=
"opacity-70 mx-1"
>
#
{
memo
.
id
}
</
span
>
<
span
className=
"truncate ml-1"
>
{
memo
.
content
}
</
span
>
<
span
className=
"truncate"
>
{
memo
.
content
}
</
span
>
</
Link
>
</
Link
>
</
div
>
</
div
>
);
);
...
...
web/src/components/MemoView.tsx
View file @
fae0b4e9
...
@@ -150,7 +150,7 @@ const MemoView: React.FC<Props> = (props: Props) => {
...
@@ -150,7 +150,7 @@ const MemoView: React.FC<Props> = (props: Props) => {
};
};
const
handleCopyMemoId
=
()
=>
{
const
handleCopyMemoId
=
()
=>
{
copy
(
String
(
memo
.
id
)
);
copy
(
memo
.
name
);
toast
.
success
(
"Copied to clipboard!"
);
toast
.
success
(
"Copied to clipboard!"
);
};
};
...
@@ -246,10 +246,10 @@ const MemoView: React.FC<Props> = (props: Props) => {
...
@@ -246,10 +246,10 @@ const MemoView: React.FC<Props> = (props: Props) => {
{
t
(
"common.delete"
)
}
{
t
(
"common.delete"
)
}
</
span
>
</
span
>
<
Divider
className=
"!my-1"
/>
<
Divider
className=
"!my-1"
/>
<
div
className=
"w-full p
x-3
text-xs text-gray-400"
>
<
div
className=
"w-full p
l-3 pr-2
text-xs text-gray-400"
>
<
span
className=
"cursor-pointer
"
onClick=
{
handleCopyMemoId
}
>
<
div
className=
"font-mono max-w-20 cursor-pointer truncate
"
onClick=
{
handleCopyMemoId
}
>
ID:
<
span
className=
"font-mono"
>
{
memo
.
id
}
</
span
>
ID:
{
memo
.
name
}
</
span
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
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