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
4a9314c4
Unverified
Commit
4a9314c4
authored
Dec 04, 2022
by
boojack
Committed by
GitHub
Dec 04, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: rename `enableFoldMemo` (#671)
* chore: rename `enableFoldMemo` * chore: update
parent
4767ee32
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
11 deletions
+11
-11
App.tsx
web/src/App.tsx
+2
-2
MemoContent.tsx
web/src/components/MemoContent.tsx
+2
-2
PreferencesSection.tsx
web/src/components/Settings/PreferencesSection.tsx
+2
-2
memo-editor.less
web/src/less/memo-editor.less
+3
-3
userService.ts
web/src/services/userService.ts
+1
-1
setting.d.ts
web/src/types/modules/setting.d.ts
+1
-1
No files found.
web/src/App.tsx
View file @
4a9314c4
...
...
@@ -4,10 +4,10 @@ import { useTranslation } from "react-i18next";
import
{
RouterProvider
}
from
"react-router-dom"
;
import
{
globalService
,
locationService
}
from
"./services"
;
import
{
useAppSelector
}
from
"./store"
;
import
Loading
from
"./pages/Loading"
;
import
router
from
"./router"
;
import
*
as
storage
from
"./helpers/storage"
;
import
{
getSystemColorScheme
}
from
"./helpers/utils"
;
import
Loading
from
"./pages/Loading"
;
function
App
()
{
const
{
i18n
}
=
useTranslation
();
...
...
@@ -69,7 +69,7 @@ function App() {
const
root
=
document
.
documentElement
;
if
(
mode
===
"light"
)
{
root
.
classList
.
remove
(
"dark"
);
}
else
{
}
else
if
(
mode
===
"dark"
)
{
root
.
classList
.
add
(
"dark"
);
}
},
[
mode
]);
...
...
web/src/components/MemoContent.tsx
View file @
4a9314c4
...
...
@@ -52,7 +52,7 @@ const MemoContent: React.FC<Props> = (props: Props) => {
return
;
}
if
(
displayConfig
.
enableExpand
&&
user
&&
user
.
localSetting
.
isFoldingEnabled
)
{
if
(
displayConfig
.
enableExpand
&&
user
&&
user
.
localSetting
.
enableFoldMemo
)
{
if
(
foldedContent
.
length
!==
content
.
length
)
{
setState
({
...
state
,
...
...
@@ -65,7 +65,7 @@ const MemoContent: React.FC<Props> = (props: Props) => {
expandButtonStatus
:
-
1
,
});
}
},
[
user
?.
localSetting
.
isFoldingEnabled
]);
},
[
user
?.
localSetting
.
enableFoldMemo
]);
const
handleMemoContentClick
=
async
(
e
:
React
.
MouseEvent
)
=>
{
if
(
onMemoContentClick
)
{
...
...
web/src/components/Settings/PreferencesSection.tsx
View file @
4a9314c4
...
...
@@ -61,7 +61,7 @@ const PreferencesSection = () => {
};
const
handleIsFoldingEnabledChanged
=
(
event
:
React
.
ChangeEvent
<
HTMLInputElement
>
)
=>
{
userService
.
upsertLocalSetting
(
"
isFoldingEnabled
"
,
event
.
target
.
checked
);
userService
.
upsertLocalSetting
(
"
enableFoldMemo
"
,
event
.
target
.
checked
);
};
return
(
...
...
@@ -129,7 +129,7 @@ const PreferencesSection = () => {
</
label
>
<
label
className=
"form-label selector"
>
<
span
className=
"normal-text"
>
{
t
(
"setting.preference-section.enable-folding-memo"
)
}
</
span
>
<
Switch
className=
"ml-2"
checked=
{
localSetting
.
isFoldingEnabled
}
onChange=
{
handleIsFoldingEnabledChanged
}
/>
<
Switch
className=
"ml-2"
checked=
{
localSetting
.
enableFoldMemo
}
onChange=
{
handleIsFoldingEnabledChanged
}
/>
</
label
>
</
div
>
);
...
...
web/src/less/memo-editor.less
View file @
4a9314c4
...
...
@@ -71,13 +71,13 @@
}
> .resource-action-list {
@apply hidden flex-col justify-start items-start absolute top-6 left-0 mt-1 p-1 z-1 rounded w-
36 max-h-52 overflow-auto font-mono bg-zinc-1
00;
@apply hidden flex-col justify-start items-start absolute top-6 left-0 mt-1 p-1 z-1 rounded w-
auto overflow-auto font-mono shadow bg-zinc-200 dark:bg-zinc-6
00;
> .resource-action-item {
@apply w-full flex text-black
cursor-pointer rounded text-sm leading-6 px-2 truncate hover:bg-zinc-3
00 shrink-0;
@apply w-full flex text-black
dark:text-gray-300 cursor-pointer rounded text-sm leading-6 px-2 truncate hover:bg-zinc-300 dark:hover:bg-zinc-7
00 shrink-0;
> .icon-img {
@apply w-4 mr-
2
;
@apply w-4 mr-
1
;
}
}
}
...
...
web/src/services/userService.ts
View file @
4a9314c4
...
...
@@ -14,7 +14,7 @@ const defaultSetting: Setting = {
};
const
defaultLocalSetting
:
LocalSetting
=
{
isFoldingEnabled
:
true
,
enableFoldMemo
:
true
,
};
export
const
convertResponseModelUser
=
(
user
:
User
):
User
=>
{
...
...
web/src/types/modules/setting.d.ts
View file @
4a9314c4
...
...
@@ -8,7 +8,7 @@ interface Setting {
}
interface
LocalSetting
{
isFoldingEnabled
:
boolean
;
enableFoldMemo
:
boolean
;
}
interface
UserLocaleSetting
{
...
...
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