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
68468927
Commit
68468927
authored
Feb 24, 2024
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: tweak setting styles
parent
dfe29ec7
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
131 additions
and
121 deletions
+131
-121
index.tsx
web/src/components/MemoEditor/Editor/index.tsx
+7
-2
MemberSection.tsx
web/src/components/Settings/MemberSection.tsx
+5
-5
PreferencesSection.tsx
web/src/components/Settings/PreferencesSection.tsx
+5
-5
SystemSection.tsx
web/src/components/Settings/SystemSection.tsx
+114
-109
No files found.
web/src/components/MemoEditor/Editor/index.tsx
View file @
68468927
...
@@ -145,9 +145,14 @@ const Editor = forwardRef(function Editor(props: Props, ref: React.ForwardedRef<
...
@@ -145,9 +145,14 @@ const Editor = forwardRef(function Editor(props: Props, ref: React.ForwardedRef<
},
[]);
},
[]);
return
(
return
(
<
div
className=
{
classNames
(
"flex flex-col justify-start items-start relative w-full h-auto bg-inherit dark:text-gray-300"
,
className
)
}
>
<
div
className=
{
classNames
(
"flex flex-col justify-start items-start relative w-full h-auto max-h-[256px] bg-inherit dark:text-gray-300"
,
className
,
)
}
>
<
textarea
<
textarea
className=
"w-full h-full m
ax-h-[300px] m
y-1 text-base resize-none overflow-x-hidden overflow-y-auto bg-transparent outline-none whitespace-pre-wrap word-break"
className=
"w-full h-full my-1 text-base resize-none overflow-x-hidden overflow-y-auto bg-transparent outline-none whitespace-pre-wrap word-break"
rows=
{
1
}
rows=
{
1
}
placeholder=
{
placeholder
}
placeholder=
{
placeholder
}
ref=
{
editorRef
}
ref=
{
editorRef
}
...
...
web/src/components/Settings/MemberSection.tsx
View file @
68468927
...
@@ -147,13 +147,13 @@ const MemberSection = () => {
...
@@ -147,13 +147,13 @@ const MemberSection = () => {
return
(
return
(
<
div
className=
"w-full flex flex-col gap-2 pt-2 pb-4"
>
<
div
className=
"w-full flex flex-col gap-2 pt-2 pb-4"
>
<
p
className=
"font-medium text-gray-700 dark:text-gray-500"
>
{
t
(
"setting.member-section.create-a-member"
)
}
</
p
>
<
p
className=
"font-medium text-gray-700 dark:text-gray-500"
>
{
t
(
"setting.member-section.create-a-member"
)
}
</
p
>
<
div
className=
"w-
full flex flex-col justify-start items-start gap-2
"
>
<
div
className=
"w-
auto flex flex-col justify-start items-start gap-2 border rounded-md py-2 px-3 dark:border-zinc-700
"
>
<
div
className=
"flex flex-col justify-start items-start gap-1"
>
<
div
className=
"flex flex-col justify-start items-start gap-1"
>
<
span
className=
"text-sm"
>
{
t
(
"common.username"
)
}
</
span
>
<
span
>
{
t
(
"common.username"
)
}
</
span
>
<
Input
type=
"text"
placeholder=
{
t
(
"common.username"
)
}
value=
{
state
.
creatingUser
.
username
}
onChange=
{
handleUsernameInputChange
}
/>
<
Input
type=
"text"
placeholder=
{
t
(
"common.username"
)
}
value=
{
state
.
creatingUser
.
username
}
onChange=
{
handleUsernameInputChange
}
/>
</
div
>
</
div
>
<
div
className=
"flex flex-col justify-start items-start gap-1"
>
<
div
className=
"flex flex-col justify-start items-start gap-1"
>
<
span
className=
"text-sm"
>
{
t
(
"common.password"
)
}
</
span
>
<
span
>
{
t
(
"common.password"
)
}
</
span
>
<
Input
<
Input
type=
"password"
type=
"password"
placeholder=
{
t
(
"common.password"
)
}
placeholder=
{
t
(
"common.password"
)
}
...
@@ -162,8 +162,8 @@ const MemberSection = () => {
...
@@ -162,8 +162,8 @@ const MemberSection = () => {
/>
/>
</
div
>
</
div
>
<
div
className=
"flex flex-col justify-start items-start gap-1"
>
<
div
className=
"flex flex-col justify-start items-start gap-1"
>
<
span
className=
"text-sm"
>
{
t
(
"common.role"
)
}
</
span
>
<
span
>
{
t
(
"common.role"
)
}
</
span
>
<
RadioGroup
size=
"sm"
orientation=
"horizontal"
defaultValue=
{
User_Role
.
USER
}
onChange=
{
handleUserRoleInputChange
}
>
<
RadioGroup
orientation=
"horizontal"
defaultValue=
{
User_Role
.
USER
}
onChange=
{
handleUserRoleInputChange
}
>
<
Radio
value=
{
User_Role
.
USER
}
label=
"User"
/>
<
Radio
value=
{
User_Role
.
USER
}
label=
"User"
/>
<
Radio
value=
{
User_Role
.
ADMIN
}
label=
"Admin"
/>
<
Radio
value=
{
User_Role
.
ADMIN
}
label=
"Admin"
/>
</
RadioGroup
>
</
RadioGroup
>
...
...
web/src/components/Settings/PreferencesSection.tsx
View file @
68468927
...
@@ -103,10 +103,10 @@ const PreferencesSection = () => {
...
@@ -103,10 +103,10 @@ const PreferencesSection = () => {
</
Select
>
</
Select
>
</
div
>
</
div
>
<
Divider
className=
"!m
t-3 !my-4
"
/>
<
Divider
className=
"!m
y-3
"
/>
<
div
className=
"
w-full flex flex-col justify-start items-start
"
>
<
div
className=
"
space-y-2 border rounded-md py-2 px-3 dark:border-zinc-700
"
>
<
div
className=
"
mb-2
w-full flex flex-row justify-between items-center"
>
<
div
className=
"w-full flex flex-row justify-between items-center"
>
<
div
className=
"w-auto flex items-center"
>
<
div
className=
"w-auto flex items-center"
>
<
span
className=
"mr-1"
>
{
t
(
"setting.preference-section.telegram-user-id"
)
}
</
span
>
<
span
className=
"mr-1"
>
{
t
(
"setting.preference-section.telegram-user-id"
)
}
</
span
>
</
div
>
</
div
>
...
@@ -126,7 +126,7 @@ const PreferencesSection = () => {
...
@@ -126,7 +126,7 @@ const PreferencesSection = () => {
/>
/>
<
div
className=
"w-full"
>
<
div
className=
"w-full"
>
<
Link
<
Link
className=
"text-gray-500 text-sm inline-flex flex-row justify-start items-center
mt-2
hover:underline hover:text-blue-600"
className=
"text-gray-500 text-sm inline-flex flex-row justify-start items-center hover:underline hover:text-blue-600"
to=
"https://usememos.com/docs/integration/telegram-bot"
to=
"https://usememos.com/docs/integration/telegram-bot"
target=
"_blank"
target=
"_blank"
>
>
...
@@ -136,7 +136,7 @@ const PreferencesSection = () => {
...
@@ -136,7 +136,7 @@ const PreferencesSection = () => {
</
div
>
</
div
>
</
div
>
</
div
>
<
Divider
className=
"!my-
4
"
/>
<
Divider
className=
"!my-
3
"
/>
<
WebhookSection
/>
<
WebhookSection
/>
</
div
>
</
div
>
...
...
web/src/components/Settings/SystemSection.tsx
View file @
68468927
...
@@ -221,48 +221,23 @@ const SystemSection = () => {
...
@@ -221,48 +221,23 @@ const SystemSection = () => {
</
div
>
</
div
>
<
Button
onClick=
{
handleUpdateCustomizedProfileButtonClick
}
>
{
t
(
"common.edit"
)
}
</
Button
>
<
Button
onClick=
{
handleUpdateCustomizedProfileButtonClick
}
>
{
t
(
"common.edit"
)
}
</
Button
>
</
div
>
</
div
>
<
p
className=
"font-medium text-gray-700 dark:text-gray-500"
>
{
t
(
"common.settings"
)
}
</
p
>
<
p
className=
"font-medium text-gray-700 dark:text-gray-500"
>
General
</
p
>
<
div
className=
"w-full flex flex-row justify-between items-center"
>
<
div
className=
"w-full flex flex-row justify-between items-center"
>
<
span
className=
"
normal-text
"
>
{
t
(
"setting.system-section.allow-user-signup"
)
}
</
span
>
<
span
className=
"
mr-1
"
>
{
t
(
"setting.system-section.allow-user-signup"
)
}
</
span
>
<
Switch
checked=
{
!
workspaceGeneralSetting
.
disallowSignup
}
onChange=
{
(
event
)
=>
handleAllowSignUpChanged
(
event
.
target
.
checked
)
}
/>
<
Switch
checked=
{
!
workspaceGeneralSetting
.
disallowSignup
}
onChange=
{
(
event
)
=>
handleAllowSignUpChanged
(
event
.
target
.
checked
)
}
/>
</
div
>
</
div
>
<
div
className=
"w-full flex flex-row justify-between items-center"
>
<
div
className=
"w-full flex flex-row justify-between items-center"
>
<
span
className=
"
normal-text
"
>
{
t
(
"setting.system-section.disable-password-login"
)
}
</
span
>
<
span
className=
"
mr-1
"
>
{
t
(
"setting.system-section.disable-password-login"
)
}
</
span
>
<
Switch
<
Switch
checked=
{
workspaceGeneralSetting
.
disallowPasswordLogin
}
checked=
{
workspaceGeneralSetting
.
disallowPasswordLogin
}
onChange=
{
(
event
)
=>
handleDisablePasswordLoginChanged
(
event
.
target
.
checked
)
}
onChange=
{
(
event
)
=>
handleDisablePasswordLoginChanged
(
event
.
target
.
checked
)
}
/>
/>
</
div
>
</
div
>
<
div
className=
"w-full flex flex-row justify-between items-center"
>
<
div
className=
"space-y-2 border rounded-md py-2 px-3 dark:border-zinc-700"
>
<
span
className=
"normal-text"
>
{
t
(
"setting.system-section.disable-public-memos"
)
}
</
span
>
<
Switch
checked=
{
state
.
disablePublicMemos
}
onChange=
{
(
event
)
=>
handleDisablePublicMemosChanged
(
event
.
target
.
checked
)
}
/>
</
div
>
<
div
className=
"w-full flex flex-row justify-between items-center"
>
<
span
className=
"normal-text"
>
{
t
(
"setting.system-section.display-with-updated-time"
)
}
</
span
>
<
Switch
checked=
{
state
.
memoDisplayWithUpdatedTs
}
onChange=
{
(
event
)
=>
handleMemoDisplayWithUpdatedTs
(
event
.
target
.
checked
)
}
/>
</
div
>
<
div
className=
"w-full flex flex-row justify-between items-center"
>
<
div
className=
"flex flex-row items-center"
>
<
span
className=
"text-sm mr-1"
>
{
t
(
"setting.system-section.max-upload-size"
)
}
</
span
>
<
Tooltip
title=
{
t
(
"setting.system-section.max-upload-size-hint"
)
}
placement=
"top"
>
<
Icon
.
HelpCircle
className=
"w-4 h-auto"
/>
</
Tooltip
>
</
div
>
<
Input
className=
"w-16"
sx=
{
{
fontFamily
:
"monospace"
,
}
}
defaultValue=
{
state
.
maxUploadSizeMiB
}
onFocus=
{
handleMaxUploadSizeFocus
}
onChange=
{
handleMaxUploadSizeChanged
}
/>
</
div
>
<
Divider
className=
"!mt-3 !my-4"
/>
<
div
className=
"w-full flex flex-row justify-between items-center"
>
<
div
className=
"w-full flex flex-row justify-between items-center"
>
<
div
className=
"flex flex-row items-center"
>
<
div
className=
"flex flex-row items-center"
>
<
div
className=
"w-auto flex items-center"
>
<
div
className=
"w-auto flex items-center"
>
<
span
className=
"text-sm
mr-1"
>
Instance URL
</
span
>
<
span
className=
"
mr-1"
>
Instance URL
</
span
>
</
div
>
</
div
>
</
div
>
</
div
>
<
Button
variant=
"outlined"
color=
"neutral"
onClick=
{
handleSaveInstanceUrl
}
>
<
Button
variant=
"outlined"
color=
"neutral"
onClick=
{
handleSaveInstanceUrl
}
>
...
@@ -281,7 +256,7 @@ const SystemSection = () => {
...
@@ -281,7 +256,7 @@ const SystemSection = () => {
/>
/>
<
div
className=
"w-full"
>
<
div
className=
"w-full"
>
<
Link
<
Link
className=
"text-gray-500 text-sm inline-flex flex-row justify-start items-center mt-2
hover:underline hover:text-blue-600"
className=
"text-gray-500 text-sm inline-flex flex-row justify-start items-center
hover:underline hover:text-blue-600"
to=
"https://usememos.com/docs/advanced-settings/seo"
to=
"https://usememos.com/docs/advanced-settings/seo"
target=
"_blank"
target=
"_blank"
>
>
...
@@ -289,38 +264,8 @@ const SystemSection = () => {
...
@@ -289,38 +264,8 @@ const SystemSection = () => {
<
Icon
.
ExternalLink
className=
"inline w-4 h-auto ml-1"
/>
<
Icon
.
ExternalLink
className=
"inline w-4 h-auto ml-1"
/>
</
Link
>
</
Link
>
</
div
>
</
div
>
<
Divider
className=
"!mt-3 !my-4"
/>
<
div
className=
"w-full flex flex-row justify-between items-center"
>
<
div
className=
"flex flex-row items-center"
>
<
div
className=
"w-auto flex items-center"
>
<
span
className=
"text-sm mr-1"
>
{
t
(
"setting.system-section.telegram-bot-token"
)
}
</
span
>
</
div
>
</
div
>
</
div
>
<
Button
variant=
"outlined"
color=
"neutral"
onClick=
{
handleSaveTelegramBotToken
}
>
<
div
className=
"space-y-2 border rounded-md py-2 px-3 dark:border-zinc-700"
>
{
t
(
"common.save"
)
}
</
Button
>
</
div
>
<
Input
className=
"w-full"
sx=
{
{
fontFamily
:
"monospace"
,
fontSize
:
"14px"
,
}
}
placeholder=
{
t
(
"setting.system-section.telegram-bot-token-placeholder"
)
}
value=
{
telegramBotToken
}
onChange=
{
(
event
)
=>
handleTelegramBotTokenChanged
(
event
.
target
.
value
)
}
/>
<
div
className=
"w-full"
>
<
Link
className=
"text-gray-500 text-sm inline-flex flex-row justify-start items-center mt-2 hover:underline hover:text-blue-600"
to=
"https://usememos.com/docs/integration/telegram-bot"
target=
"_blank"
>
{
t
(
"common.learn-more"
)
}
<
Icon
.
ExternalLink
className=
"inline w-4 h-auto ml-1"
/>
</
Link
>
</
div
>
<
Divider
className=
"!mt-3 !my-4"
/>
<
div
className=
"w-full flex flex-row justify-between items-center"
>
<
div
className=
"w-full flex flex-row justify-between items-center"
>
<
span
className=
"normal-text"
>
{
t
(
"setting.system-section.additional-style"
)
}
</
span
>
<
span
className=
"normal-text"
>
{
t
(
"setting.system-section.additional-style"
)
}
</
span
>
<
Button
variant=
"outlined"
color=
"neutral"
onClick=
{
handleSaveAdditionalStyle
}
>
<
Button
variant=
"outlined"
color=
"neutral"
onClick=
{
handleSaveAdditionalStyle
}
>
...
@@ -339,7 +284,7 @@ const SystemSection = () => {
...
@@ -339,7 +284,7 @@ const SystemSection = () => {
value=
{
workspaceGeneralSetting
.
additionalStyle
}
value=
{
workspaceGeneralSetting
.
additionalStyle
}
onChange=
{
(
event
)
=>
handleAdditionalStyleChanged
(
event
.
target
.
value
)
}
onChange=
{
(
event
)
=>
handleAdditionalStyleChanged
(
event
.
target
.
value
)
}
/>
/>
<
div
className=
"w-full flex flex-row justify-between items-center mt-2
"
>
<
div
className=
"w-full flex flex-row justify-between items-center
"
>
<
span
className=
"normal-text"
>
{
t
(
"setting.system-section.additional-script"
)
}
</
span
>
<
span
className=
"normal-text"
>
{
t
(
"setting.system-section.additional-script"
)
}
</
span
>
<
Button
variant=
"outlined"
color=
"neutral"
onClick=
{
handleSaveAdditionalScript
}
>
<
Button
variant=
"outlined"
color=
"neutral"
onClick=
{
handleSaveAdditionalScript
}
>
{
t
(
"common.save"
)
}
{
t
(
"common.save"
)
}
...
@@ -360,7 +305,7 @@ const SystemSection = () => {
...
@@ -360,7 +305,7 @@ const SystemSection = () => {
/>
/>
<
div
className=
"w-full"
>
<
div
className=
"w-full"
>
<
Link
<
Link
className=
"text-gray-500 text-sm flex flex-row justify-start items-center mt-2
hover:underline hover:text-blue-600"
className=
"text-gray-500 text-sm flex flex-row justify-start items-center
hover:underline hover:text-blue-600"
to=
"https://usememos.com/docs/advanced-settings/custom-style-and-script"
to=
"https://usememos.com/docs/advanced-settings/custom-style-and-script"
target=
"_blank"
target=
"_blank"
>
>
...
@@ -369,6 +314,66 @@ const SystemSection = () => {
...
@@ -369,6 +314,66 @@ const SystemSection = () => {
</
Link
>
</
Link
>
</
div
>
</
div
>
</
div
>
</
div
>
<
Divider
className=
"!my-3"
/>
<
p
className=
"font-medium text-gray-700 dark:text-gray-500"
>
Others
</
p
>
<
div
className=
"w-full flex flex-row justify-between items-center"
>
<
span
className=
"normal-text"
>
{
t
(
"setting.system-section.disable-public-memos"
)
}
</
span
>
<
Switch
checked=
{
state
.
disablePublicMemos
}
onChange=
{
(
event
)
=>
handleDisablePublicMemosChanged
(
event
.
target
.
checked
)
}
/>
</
div
>
<
div
className=
"w-full flex flex-row justify-between items-center"
>
<
span
className=
"normal-text"
>
{
t
(
"setting.system-section.display-with-updated-time"
)
}
</
span
>
<
Switch
checked=
{
state
.
memoDisplayWithUpdatedTs
}
onChange=
{
(
event
)
=>
handleMemoDisplayWithUpdatedTs
(
event
.
target
.
checked
)
}
/>
</
div
>
<
div
className=
"w-full flex flex-row justify-between items-center"
>
<
div
className=
"flex flex-row items-center"
>
<
span
className=
"text-sm mr-1"
>
{
t
(
"setting.system-section.max-upload-size"
)
}
</
span
>
<
Tooltip
title=
{
t
(
"setting.system-section.max-upload-size-hint"
)
}
placement=
"top"
>
<
Icon
.
HelpCircle
className=
"w-4 h-auto"
/>
</
Tooltip
>
</
div
>
<
Input
className=
"w-16"
sx=
{
{
fontFamily
:
"monospace"
,
}
}
defaultValue=
{
state
.
maxUploadSizeMiB
}
onFocus=
{
handleMaxUploadSizeFocus
}
onChange=
{
handleMaxUploadSizeChanged
}
/>
</
div
>
<
div
className=
"space-y-2 border rounded-md py-2 px-3 dark:border-zinc-700"
>
<
div
className=
"w-full flex flex-row justify-between items-center"
>
<
div
className=
"flex flex-row items-center"
>
<
div
className=
"w-auto flex items-center"
>
<
span
className=
"mr-1"
>
{
t
(
"setting.system-section.telegram-bot-token"
)
}
</
span
>
</
div
>
</
div
>
<
Button
variant=
"outlined"
color=
"neutral"
onClick=
{
handleSaveTelegramBotToken
}
>
{
t
(
"common.save"
)
}
</
Button
>
</
div
>
<
Input
className=
"w-full"
sx=
{
{
fontFamily
:
"monospace"
,
fontSize
:
"14px"
,
}
}
placeholder=
{
t
(
"setting.system-section.telegram-bot-token-placeholder"
)
}
value=
{
telegramBotToken
}
onChange=
{
(
event
)
=>
handleTelegramBotTokenChanged
(
event
.
target
.
value
)
}
/>
<
div
className=
"w-full"
>
<
Link
className=
"text-gray-500 text-sm inline-flex flex-row justify-start items-center hover:underline hover:text-blue-600"
to=
"https://usememos.com/docs/integration/telegram-bot"
target=
"_blank"
>
{
t
(
"common.learn-more"
)
}
<
Icon
.
ExternalLink
className=
"inline w-4 h-auto ml-1"
/>
</
Link
>
</
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