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
0e8d3e69
Commit
0e8d3e69
authored
Jul 05, 2022
by
boojack
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: fix memos amount
parent
592e037f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
29 deletions
+25
-29
MyAccountSection.tsx
web/src/components/Settings/MyAccountSection.tsx
+2
-2
editor.less
web/src/less/editor.less
+2
-2
setting-dialog.less
web/src/less/setting-dialog.less
+2
-2
memo.ts
web/src/store/modules/memo.ts
+18
-16
tailwind.config.js
web/tailwind.config.js
+1
-7
No files found.
web/src/components/Settings/MyAccountSection.tsx
View file @
0e8d3e69
...
...
@@ -19,7 +19,7 @@ interface Props {}
const
MyAccountSection
:
React
.
FC
<
Props
>
=
()
=>
{
const
user
=
useAppSelector
((
state
)
=>
state
.
user
.
user
as
User
);
const
[
username
,
setUsername
]
=
useState
<
string
>
(
user
.
name
);
const
openAPIRoute
=
`
${
window
.
location
.
origin
}
/
h/
${
user
.
openId
}
/memo
`
;
const
openAPIRoute
=
`
${
window
.
location
.
origin
}
/
api/memo?openId=
${
user
.
openId
}
`
;
const
handleUsernameChanged
=
(
e
:
React
.
ChangeEvent
<
HTMLInputElement
>
)
=>
{
const
nextUsername
=
e
.
target
.
value
as
string
;
...
...
@@ -100,7 +100,7 @@ const MyAccountSection: React.FC<Props> = () => {
</
span
>
<
div
className=
"usage-guide-container"
>
<
p
className=
"title-text"
>
Usage guide:
</
p
>
<
pre
>
{
`POST ${openAPIRoute}\nContent-type: application/json\n{\n "content": "Hello
, #memos
${window.location.origin}"\n}`
}
</
pre
>
<
pre
>
{
`POST ${openAPIRoute}\nContent-type: application/json\n{\n "content": "Hello
#memos from
${window.location.origin}"\n}`
}
</
pre
>
</
div
>
</
div
>
</>
...
...
web/src/less/editor.less
View file @
0e8d3e69
...
...
@@ -29,7 +29,7 @@
@apply flex flex-row justify-start items-center;
> .action-btn {
@apply flex flex-row justify-start items-center p-1 w-auto h-auto mr-1 select-none rounded cursor-pointer opacity-60 hover:opacity-
8
0 hover:bg-gray-300 hover:shadow;
@apply flex flex-row justify-start items-center p-1 w-auto h-auto mr-1 select-none rounded cursor-pointer opacity-60 hover:opacity-
9
0 hover:bg-gray-300 hover:shadow;
> .icon-img {
@apply w-5 h-auto;
...
...
@@ -49,7 +49,7 @@
}
> .tag-list {
@apply hidden flex-col justify-start items-start absolute top-6 left-0 p-1 z-10 rounded w-32 max-h-52 overflow-auto bg-black;
@apply hidden flex-col justify-start items-start absolute top-6 left-0
mt-1
p-1 z-10 rounded w-32 max-h-52 overflow-auto bg-black;
> span {
@apply w-full text-white cursor-pointer rounded text-sm leading-6 px-2 hover:bg-gray-700;
...
...
web/src/less/setting-dialog.less
View file @
0e8d3e69
...
...
@@ -4,7 +4,7 @@
@apply px-4;
> .dialog-container {
@apply w-1
76
max-w-full mb-8 p-0;
@apply w-1
80
max-w-full mb-8 p-0;
> .dialog-content-container {
.flex(column, flex-start, flex-start);
...
...
@@ -38,7 +38,7 @@
}
> .icon-text {
@apply text-base mr-
1
;
@apply text-base mr-
2
;
}
}
}
...
...
web/src/store/modules/memo.ts
View file @
0e8d3e69
...
...
@@ -15,34 +15,36 @@ const memoSlice = createSlice({
setMemos
:
(
state
,
action
:
PayloadAction
<
Memo
[]
>
)
=>
{
return
{
...
state
,
memos
:
action
.
payload
,
memos
:
action
.
payload
.
filter
((
m
)
=>
m
.
rowStatus
===
"NORMAL"
).
sort
((
a
,
b
)
=>
b
.
createdTs
-
a
.
createdTs
)
,
};
},
setTags
:
(
state
,
action
:
PayloadAction
<
string
[]
>
)
=>
{
createMemo
:
(
state
,
action
:
PayloadAction
<
Memo
>
)
=>
{
return
{
...
state
,
tags
:
action
.
payload
,
memos
:
state
.
memos
.
concat
(
action
.
payload
).
sort
((
a
,
b
)
=>
b
.
createdTs
-
a
.
createdTs
)
,
};
},
createMemo
:
(
state
,
action
:
PayloadAction
<
Memo
>
)
=>
{
patchMemo
:
(
state
,
action
:
PayloadAction
<
Partial
<
Memo
>
>
)
=>
{
return
{
...
state
,
memos
:
state
.
memos
.
concat
(
action
.
payload
).
sort
((
a
,
b
)
=>
b
.
createdTs
-
a
.
createdTs
),
memos
:
state
.
memos
.
map
((
memo
)
=>
{
if
(
memo
.
id
===
action
.
payload
.
id
)
{
return
{
...
memo
,
...
action
.
payload
,
};
}
else
{
return
memo
;
}
})
.
filter
((
memo
)
=>
memo
.
rowStatus
===
"NORMAL"
),
};
},
patchMemo
:
(
state
,
action
:
PayloadAction
<
Partial
<
Memo
>
>
)
=>
{
setTags
:
(
state
,
action
:
PayloadAction
<
string
[]
>
)
=>
{
return
{
...
state
,
memos
:
state
.
memos
.
map
((
m
)
=>
{
if
(
m
.
id
===
action
.
payload
.
id
)
{
return
{
...
m
,
...
action
.
payload
,
};
}
else
{
return
m
;
}
}),
tags
:
action
.
payload
,
};
},
},
...
...
web/tailwind.config.js
View file @
0e8d3e69
...
...
@@ -16,18 +16,12 @@ module.exports = {
spacing
:
{
112
:
"28rem"
,
128
:
"32rem"
,
168
:
"42rem"
,
176
:
"44rem"
,
200
:
"50rem"
,
180
:
"45rem"
,
},
zIndex
:
{
100
:
"100"
,
1000
:
"1000"
,
},
gridTemplateRows
:
{
7
:
"repeat(7, minmax(0, 1fr))"
,
},
},
},
plugins
:
[],
};
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