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
fd7043ea
Commit
fd7043ea
authored
Oct 05, 2023
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: fix editor cache
parent
34ae9b06
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
7 deletions
+12
-7
CreateTagDialog.tsx
web/src/components/CreateTagDialog.tsx
+6
-3
MemoEditorDialog.tsx
web/src/components/MemoEditor/MemoEditorDialog.tsx
+1
-1
index.tsx
web/src/components/MemoEditor/index.tsx
+3
-2
Home.tsx
web/src/pages/Home.tsx
+1
-1
MemoDetail.tsx
web/src/pages/MemoDetail.tsx
+1
-0
No files found.
web/src/components/CreateTagDialog.tsx
View file @
fd7043ea
...
@@ -124,9 +124,12 @@ const CreateTagDialog: React.FC<Props> = (props: Props) => {
...
@@ -124,9 +124,12 @@ const CreateTagDialog: React.FC<Props> = (props: Props) => {
<>
<>
<
div
className=
"mt-4 mb-1 text-sm w-full flex flex-row justify-start items-center"
>
<
div
className=
"mt-4 mb-1 text-sm w-full flex flex-row justify-start items-center"
>
<
span
className=
"text-gray-400 mr-2"
>
{
t
(
"tag-list.tag-suggestions"
)
}
</
span
>
<
span
className=
"text-gray-400 mr-2"
>
{
t
(
"tag-list.tag-suggestions"
)
}
</
span
>
<
Button
size=
"sm"
variant=
"outlined"
onClick=
{
handleToggleShowSuggestionTags
}
>
<
span
className=
"text-xs border border-gray-200 rounded-md px-1 leading-5 cursor-pointer text-gray-600 hover:shadow dark:border-zinc-700 dark:text-gray-400"
onClick=
{
handleToggleShowSuggestionTags
}
>
{
showTagSuggestions
?
t
(
"tag-list.hide"
)
:
t
(
"tag-list.show"
)
}
{
showTagSuggestions
?
t
(
"tag-list.hide"
)
:
t
(
"tag-list.show"
)
}
</
Butto
n
>
</
spa
n
>
</
div
>
</
div
>
{
showTagSuggestions
&&
(
{
showTagSuggestions
&&
(
<>
<>
...
@@ -141,7 +144,7 @@ const CreateTagDialog: React.FC<Props> = (props: Props) => {
...
@@ -141,7 +144,7 @@ const CreateTagDialog: React.FC<Props> = (props: Props) => {
</
span
>
</
span
>
))
}
))
}
</
div
>
</
div
>
<
Button
size=
"sm"
onClick=
{
handleSaveSuggestTagList
}
>
<
Button
size=
"sm"
variant=
"outlined"
onClick=
{
handleSaveSuggestTagList
}
>
{
t
(
"tag-list.save-all"
)
}
{
t
(
"tag-list.save-all"
)
}
</
Button
>
</
Button
>
</>
</>
...
...
web/src/components/MemoEditor/MemoEditorDialog.tsx
View file @
fd7043ea
...
@@ -31,7 +31,7 @@ const MemoEditorDialog: React.FC<Props> = ({ memoId, relationList, destroy }: Pr
...
@@ -31,7 +31,7 @@ const MemoEditorDialog: React.FC<Props> = ({ memoId, relationList, destroy }: Pr
</
button
>
</
button
>
</
div
>
</
div
>
<
div
className=
"flex flex-col justify-start items-start max-w-full w-[36rem]"
>
<
div
className=
"flex flex-col justify-start items-start max-w-full w-[36rem]"
>
<
MemoEditor
memoId=
{
memoId
}
relationList=
{
relationList
}
onConfirm=
{
handleCloseBtnClick
}
/>
<
MemoEditor
cacheKey=
{
`memo-editor-${memoId}`
}
memoId=
{
memoId
}
relationList=
{
relationList
}
onConfirm=
{
handleCloseBtnClick
}
/>
</
div
>
</
div
>
</>
</>
);
);
...
...
web/src/components/MemoEditor/index.tsx
View file @
fd7043ea
...
@@ -23,6 +23,7 @@ const emptyOlReg = /^(\d+)\. $/;
...
@@ -23,6 +23,7 @@ const emptyOlReg = /^(\d+)\. $/;
interface
Props
{
interface
Props
{
className
?:
string
;
className
?:
string
;
cacheKey
?:
string
;
memoId
?:
MemoId
;
memoId
?:
MemoId
;
relationList
?:
MemoRelation
[];
relationList
?:
MemoRelation
[];
onConfirm
?:
()
=>
void
;
onConfirm
?:
()
=>
void
;
...
@@ -37,10 +38,10 @@ interface State {
...
@@ -37,10 +38,10 @@ interface State {
}
}
const
MemoEditor
=
(
props
:
Props
)
=>
{
const
MemoEditor
=
(
props
:
Props
)
=>
{
const
{
className
,
memoId
,
onConfirm
}
=
props
;
const
{
className
,
cacheKey
,
memoId
,
onConfirm
}
=
props
;
const
{
i18n
}
=
useTranslation
();
const
{
i18n
}
=
useTranslation
();
const
t
=
useTranslate
();
const
t
=
useTranslate
();
const
[
contentCache
,
setContentCache
]
=
useLocalStorage
<
string
>
(
`memo-editor-
${
props
.
memoId
||
"0"
}
`
,
""
);
const
[
contentCache
,
setContentCache
]
=
useLocalStorage
<
string
>
(
`memo-editor-
${
cacheKey
}
`
,
""
);
const
{
const
{
state
:
{
systemStatus
},
state
:
{
systemStatus
},
}
=
useGlobalStore
();
}
=
useGlobalStore
();
...
...
web/src/pages/Home.tsx
View file @
fd7043ea
...
@@ -10,7 +10,7 @@ const Home = () => {
...
@@ -10,7 +10,7 @@ const Home = () => {
<
div
className=
"flex-grow shrink w-auto px-4 sm:px-2 sm:pt-4"
>
<
div
className=
"flex-grow shrink w-auto px-4 sm:px-2 sm:pt-4"
>
<
MobileHeader
/>
<
MobileHeader
/>
<
div
className=
"w-full h-auto flex flex-col justify-start items-start bg-zinc-100 dark:bg-zinc-800 rounded-lg"
>
<
div
className=
"w-full h-auto flex flex-col justify-start items-start bg-zinc-100 dark:bg-zinc-800 rounded-lg"
>
<
MemoEditor
className=
"mb-2"
/>
<
MemoEditor
className=
"mb-2"
cacheKey=
"home-memo-editor"
/>
<
MemoFilter
/>
<
MemoFilter
/>
</
div
>
</
div
>
<
MemoList
/>
<
MemoList
/>
...
...
web/src/pages/MemoDetail.tsx
View file @
fd7043ea
...
@@ -205,6 +205,7 @@ const MemoDetail = () => {
...
@@ -205,6 +205,7 @@ const MemoDetail = () => {
<
MemoEditor
<
MemoEditor
key=
{
memo
.
id
}
key=
{
memo
.
id
}
className=
"!border"
className=
"!border"
cacheKey=
{
`comment-editor-${memo.id}`
}
relationList=
{
[{
memoId
:
UNKNOWN_ID
,
relatedMemoId
:
memo
.
id
,
type
:
"COMMENT"
}]
}
relationList=
{
[{
memoId
:
UNKNOWN_ID
,
relatedMemoId
:
memo
.
id
,
type
:
"COMMENT"
}]
}
onConfirm=
{
handleCommentCreated
}
onConfirm=
{
handleCommentCreated
}
/>
/>
...
...
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