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
82effea0
Unverified
Commit
82effea0
authored
Oct 22, 2023
by
Christopher
Committed by
GitHub
Oct 22, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tweak(web): use iconbutton for editor helpers (#2426)
parent
331f4dcc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
16 deletions
+26
-16
TagSelector.tsx
web/src/components/MemoEditor/ActionButton/TagSelector.tsx
+4
-3
index.tsx
web/src/components/MemoEditor/index.tsx
+22
-13
No files found.
web/src/components/MemoEditor/ActionButton/TagSelector.tsx
View file @
82effea0
import
{
IconButton
}
from
"@mui/joy"
;
import
Icon
from
"@/components/Icon"
;
import
{
useTagStore
}
from
"@/store/module"
;
...
...
@@ -11,9 +12,9 @@ const TagSelector = (props: Props) => {
const
tags
=
tagStore
.
state
.
tags
;
return
(
<
div
className=
"relative group flex flex-row justify-center items-center p-1 w-auto h-auto mr-1 select-none rounded cursor-pointer text-gray-600 dark:text-gray-400 hover:bg-gray-300 dark:hover:bg-zinc-800 hover:shadow"
>
<
IconButton
className=
"relative group flex flex-row justify-center items-center p-1 w-auto h-auto mr-1 select-none rounded cursor-pointer text-gray-600 dark:text-gray-400 hover:bg-gray-300 dark:hover:bg-zinc-800 hover:shadow"
>
<
Icon
.
Hash
className=
"w-5 h-5 mx-auto"
/>
<
div
className=
"hidden flex-row justify-start items-start flex-wrap absolute top-
6
left-0 mt-1 p-1 z-1 rounded w-52 h-auto max-h-48 overflow-y-auto font-mono shadow bg-zinc-200 dark:bg-zinc-600 group-hover:flex"
>
<
div
className=
"hidden flex-row justify-start items-start flex-wrap absolute top-
8
left-0 mt-1 p-1 z-1 rounded w-52 h-auto max-h-48 overflow-y-auto font-mono shadow bg-zinc-200 dark:bg-zinc-600 group-hover:flex"
>
{
tags
.
length
>
0
?
(
tags
.
map
((
tag
)
=>
{
return
(
...
...
@@ -32,7 +33,7 @@ const TagSelector = (props: Props) => {
</
p
>
)
}
</
div
>
</
div
>
</
IconButton
>
);
};
...
...
web/src/components/MemoEditor/index.tsx
View file @
82effea0
import
{
Select
,
Option
,
Button
}
from
"@mui/joy"
;
import
{
Select
,
Option
,
Button
,
IconButton
}
from
"@mui/joy"
;
import
{
isNumber
,
last
,
uniq
,
uniqBy
}
from
"lodash-es"
;
import
React
,
{
useCallback
,
useEffect
,
useMemo
,
useRef
,
useState
}
from
"react"
;
import
{
toast
}
from
"react-hot-toast"
;
...
...
@@ -424,18 +424,27 @@ const MemoEditor = (props: Props) => {
<
div
className=
"relative w-full flex flex-row justify-between items-center pt-2 z-1"
>
<
div
className=
"flex flex-row justify-start items-center"
>
<
TagSelector
onTagSelectorClick=
{
(
tag
)
=>
handleTagSelectorClick
(
tag
)
}
/>
<
button
className=
"flex flex-row justify-center items-center p-1 w-auto h-auto mr-1 select-none rounded cursor-pointer text-gray-600 dark:text-gray-400 hover:bg-gray-300 dark:hover:bg-zinc-800 hover:shadow"
>
<
Icon
.
Image
className=
"w-5 h-5 mx-auto"
onClick=
{
handleUploadFileBtnClick
}
/>
</
button
>
<
button
className=
"flex flex-row justify-center items-center p-1 w-auto h-auto mr-1 select-none rounded cursor-pointer text-gray-600 dark:text-gray-400 hover:bg-gray-300 dark:hover:bg-zinc-800 hover:shadow"
>
<
Icon
.
Link
className=
"w-5 h-5 mx-auto"
onClick=
{
handleAddMemoRelationBtnClick
}
/>
</
button
>
<
button
className=
"flex flex-row justify-center items-center p-1 w-auto h-auto mr-1 select-none rounded cursor-pointer text-gray-600 dark:text-gray-400 hover:bg-gray-300 dark:hover:bg-zinc-800 hover:shadow"
>
<
Icon
.
CheckSquare
className=
"w-5 h-5 mx-auto"
onClick=
{
handleCheckBoxBtnClick
}
/>
</
button
>
<
button
className=
"flex flex-row justify-center items-center p-1 w-auto h-auto mr-1 select-none rounded cursor-pointer text-gray-600 dark:text-gray-400 hover:bg-gray-300 dark:hover:bg-zinc-800 hover:shadow"
>
<
Icon
.
Code
className=
"w-5 h-5 mx-auto"
onClick=
{
handleCodeBlockBtnClick
}
/>
</
button
>
<
IconButton
onClick=
{
handleUploadFileBtnClick
}
className=
"flex flex-row justify-center items-center p-1 w-auto h-auto mr-1 select-none rounded cursor-pointer text-gray-600 dark:text-gray-400 hover:bg-gray-300 dark:hover:bg-zinc-800 hover:shadow"
>
<
Icon
.
Image
className=
"w-5 h-5 mx-auto"
/>
</
IconButton
>
<
IconButton
onClick=
{
handleAddMemoRelationBtnClick
}
className=
"flex flex-row justify-center items-center p-1 w-auto h-auto mr-1 select-none rounded cursor-pointer text-gray-600 dark:text-gray-400 hover:bg-gray-300 dark:hover:bg-zinc-800 hover:shadow"
>
<
Icon
.
Link
className=
"w-5 h-5 mx-auto"
/>
</
IconButton
>
<
IconButton
onClick=
{
handleCheckBoxBtnClick
}
>
<
Icon
.
CheckSquare
className=
"w-5 h-5 mx-auto"
/>
</
IconButton
>
<
IconButton
onClick=
{
handleCodeBlockBtnClick
}
className=
"flex flex-row justify-center items-center p-1 w-auto h-auto mr-1 select-none rounded cursor-pointer text-gray-600 dark:text-gray-400 hover:bg-gray-300 dark:hover:bg-zinc-800 hover:shadow"
>
<
Icon
.
Code
className=
"w-5 h-5 mx-auto"
/>
</
IconButton
>
</
div
>
</
div
>
<
ResourceListView
resourceList=
{
state
.
resourceList
}
setResourceList=
{
handleSetResourceList
}
/>
...
...
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