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
a4235bb4
Commit
a4235bb4
authored
May 08, 2024
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: tweak tags style
parent
e0977e53
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
18 deletions
+13
-18
TagsSection.tsx
web/src/components/HomeSidebar/TagsSection.tsx
+10
-16
UserStatisticsView.tsx
web/src/components/UserStatisticsView.tsx
+1
-1
base-dialog.less
web/src/less/base-dialog.less
+1
-1
tailwind.config.js
web/tailwind.config.js
+1
-0
No files found.
web/src/components/HomeSidebar/TagsSection.tsx
View file @
a4235bb4
...
@@ -11,10 +11,8 @@ import showRenameTagDialog from "../RenameTagDialog";
...
@@ -11,10 +11,8 @@ import showRenameTagDialog from "../RenameTagDialog";
const
TagsSection
=
()
=>
{
const
TagsSection
=
()
=>
{
const
t
=
useTranslate
();
const
t
=
useTranslate
();
const
filterStore
=
useFilterStore
();
const
tagStore
=
useTagStore
();
const
tagStore
=
useTagStore
();
const
memoList
=
useMemoList
();
const
memoList
=
useMemoList
();
const
filter
=
filterStore
.
state
;
const
tagAmounts
=
Object
.
entries
(
tagStore
.
getState
().
tagAmounts
)
const
tagAmounts
=
Object
.
entries
(
tagStore
.
getState
().
tagAmounts
)
.
sort
((
a
,
b
)
=>
a
[
0
].
localeCompare
(
b
[
0
]))
.
sort
((
a
,
b
)
=>
a
[
0
].
localeCompare
(
b
[
0
]))
.
sort
((
a
,
b
)
=>
b
[
1
]
-
a
[
1
]);
.
sort
((
a
,
b
)
=>
b
[
1
]
-
a
[
1
]);
...
@@ -55,9 +53,9 @@ const TagsSection = () => {
...
@@ -55,9 +53,9 @@ const TagsSection = () => {
</
div
>
</
div
>
</
div
>
</
div
>
{
tagAmounts
.
length
>
0
?
(
{
tagAmounts
.
length
>
0
?
(
<
div
className=
"w-full flex flex-row justify-start items-center relative flex-wrap gap-1"
>
<
div
className=
"w-full flex flex-row justify-start items-center relative flex-wrap gap-
x-2 gap-y-
1"
>
{
tagAmounts
.
map
(([
tag
,
amount
])
=>
(
{
tagAmounts
.
map
(([
tag
,
amount
])
=>
(
<
TagContainer
key=
{
tag
}
tag=
{
tag
}
amount=
{
amount
}
tagQuery=
{
filter
.
tag
}
/>
<
TagContainer
key=
{
tag
}
tag=
{
tag
}
amount=
{
amount
}
/>
))
}
))
}
</
div
>
</
div
>
)
:
(
)
:
(
...
@@ -73,18 +71,16 @@ const TagsSection = () => {
...
@@ -73,18 +71,16 @@ const TagsSection = () => {
interface
TagContainerProps
{
interface
TagContainerProps
{
tag
:
string
;
tag
:
string
;
amount
:
number
;
amount
:
number
;
tagQuery
?:
string
;
}
}
const
TagContainer
:
React
.
FC
<
TagContainerProps
>
=
(
props
:
TagContainerProps
)
=>
{
const
TagContainer
:
React
.
FC
<
TagContainerProps
>
=
(
props
:
TagContainerProps
)
=>
{
const
t
=
useTranslate
();
const
t
=
useTranslate
();
const
filterStore
=
useFilterStore
();
const
filterStore
=
useFilterStore
();
const
tagStore
=
useTagStore
();
const
tagStore
=
useTagStore
();
const
{
tag
,
amount
,
tagQuery
}
=
props
;
const
{
tag
,
amount
}
=
props
;
const
isActive
=
tagQuery
===
tag
;
const
handleTagClick
=
()
=>
{
const
handleTagClick
=
()
=>
{
if
(
isActive
)
{
if
(
filterStore
.
getState
().
tag
===
tag
)
{
filterStore
.
setTagFilter
(
undefined
);
filterStore
.
setTagFilter
(
undefined
);
}
else
{
}
else
{
filterStore
.
setTagFilter
(
tag
);
filterStore
.
setTagFilter
(
tag
);
...
@@ -106,14 +102,12 @@ const TagContainer: React.FC<TagContainerProps> = (props: TagContainerProps) =>
...
@@ -106,14 +102,12 @@ const TagContainer: React.FC<TagContainerProps> = (props: TagContainerProps) =>
return
(
return
(
<
div
<
div
className=
{
`shrink-0 w-auto max-w-full border text-sm rounded-md leading-6 flex flex-row justify-start items-center select-none hover:shadow-sm dark:hover:opacity-80 text-gray-600 dark:text-gray-400 dark:border-zinc-800 ${
className=
{
`shrink-0 w-auto max-w-full text-sm rounded-md leading-6 flex flex-row justify-start items-center select-none hover:opacity-80 text-gray-600 dark:text-gray-400 dark:border-zinc-800`
}
isActive && "bg-blue-50 dark:bg-zinc-800"
}`
}
>
>
<
Dropdown
>
<
Dropdown
>
<
MenuButton
slots=
{
{
root
:
"div"
}
}
>
<
MenuButton
slots=
{
{
root
:
"div"
}
}
>
<
div
className=
"shrink-0 group
ml-1
"
>
<
div
className=
"shrink-0 group"
>
<
Icon
.
Hash
className=
"group-hover:hidden w-4 h-auto shrink-0 opacity-
6
0"
/>
<
Icon
.
Hash
className=
"group-hover:hidden w-4 h-auto shrink-0 opacity-
4
0"
/>
<
Icon
.
MoreVertical
className=
"hidden group-hover:block w-4 h-auto shrink-0 opacity-60"
/>
<
Icon
.
MoreVertical
className=
"hidden group-hover:block w-4 h-auto shrink-0 opacity-60"
/>
</
div
>
</
div
>
</
MenuButton
>
</
MenuButton
>
...
@@ -128,9 +122,9 @@ const TagContainer: React.FC<TagContainerProps> = (props: TagContainerProps) =>
...
@@ -128,9 +122,9 @@ const TagContainer: React.FC<TagContainerProps> = (props: TagContainerProps) =>
</
MenuItem
>
</
MenuItem
>
</
Menu
>
</
Menu
>
</
Dropdown
>
</
Dropdown
>
<
div
className=
"inline-flex flex-nowrap
pl-0.5 pr-1 gap-1 cursor-pointer max-w-[calc(100%-20
px)]"
onClick=
{
handleTagClick
}
>
<
div
className=
"inline-flex flex-nowrap
ml-0.5 gap-0.5 cursor-pointer max-w-[calc(100%-16
px)]"
onClick=
{
handleTagClick
}
>
<
span
className=
"truncate"
>
{
tag
}
</
span
>
<
span
className=
"truncate
dark:opacity-80
"
>
{
tag
}
</
span
>
<
span
className=
"opacity-60 shrink-0"
>
(
{
amount
}
)
</
span
>
{
amount
>
1
&&
<
span
className=
"opacity-60 shrink-0"
>
(
{
amount
}
)
</
span
>
}
</
div
>
</
div
>
</
div
>
</
div
>
);
);
...
...
web/src/components/UserStatisticsView.tsx
View file @
a4235bb4
...
@@ -57,7 +57,7 @@ const UserStatisticsView = (props: Props) => {
...
@@ -57,7 +57,7 @@ const UserStatisticsView = (props: Props) => {
</
div
>
</
div
>
<
div
className=
"w-full flex justify-between items-center"
>
<
div
className=
"w-full flex justify-between items-center"
>
<
div
className=
"w-full flex justify-start items-center"
>
<
div
className=
"w-full flex justify-start items-center"
>
<
Icon
.
Hash
className=
"w-4 h-auto mr-1"
/>
<
Icon
.
Tags
className=
"w-4 h-auto mr-1"
/>
<
span
className=
"block text-base sm:text-sm"
>
{
t
(
"common.tags"
)
}
</
span
>
<
span
className=
"block text-base sm:text-sm"
>
{
t
(
"common.tags"
)
}
</
span
>
</
div
>
</
div
>
<
span
className=
"font-mono"
>
{
tags
}
</
span
>
<
span
className=
"font-mono"
>
{
tags
}
</
span
>
...
...
web/src/less/base-dialog.less
View file @
a4235bb4
.dialog-wrapper {
.dialog-wrapper {
@apply fixed top-0 left-0 flex flex-col justify-start items-center w-full h-full pt-16 pb-8 px-4 z-
1
000 overflow-x-hidden overflow-y-scroll bg-transparent transition-all hide-scrollbar bg-black bg-opacity-60;
@apply fixed top-0 left-0 flex flex-col justify-start items-center w-full h-full pt-16 pb-8 px-4 z-
2
000 overflow-x-hidden overflow-y-scroll bg-transparent transition-all hide-scrollbar bg-black bg-opacity-60;
> .dialog-container {
> .dialog-container {
@apply max-w-full shadow flex flex-col justify-start items-start bg-white dark:bg-zinc-800 dark:text-gray-300 p-4 rounded-lg;
@apply max-w-full shadow flex flex-col justify-start items-start bg-white dark:bg-zinc-800 dark:text-gray-300 p-4 rounded-lg;
...
...
web/tailwind.config.js
View file @
a4235bb4
...
@@ -28,6 +28,7 @@ module.exports = {
...
@@ -28,6 +28,7 @@ module.exports = {
20
:
"20"
,
20
:
"20"
,
100
:
"100"
,
100
:
"100"
,
1000
:
"1000"
,
1000
:
"1000"
,
2000
:
"2000"
,
},
},
gridTemplateRows
:
{
gridTemplateRows
:
{
7
:
"repeat(7, minmax(0, 1fr))"
,
7
:
"repeat(7, minmax(0, 1fr))"
,
...
...
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