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
2136a954
Commit
2136a954
authored
Jul 05, 2022
by
boojack
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: make editor sticky
parent
0e8d3e69
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
33 additions
and
25 deletions
+33
-25
MemoCardDialog.tsx
web/src/components/MemoCardDialog.tsx
+7
-2
editor.less
web/src/less/editor.less
+1
-2
home.less
web/src/less/home.less
+8
-4
memo.less
web/src/less/memo.less
+1
-1
memos-header.less
web/src/less/memos-header.less
+4
-7
preview-image-dialog.less
web/src/less/preview-image-dialog.less
+2
-2
share-memo-image-dialog.less
web/src/less/share-memo-image-dialog.less
+1
-2
shortcut-list.less
web/src/less/shortcut-list.less
+1
-1
Home.tsx
web/src/pages/Home.tsx
+5
-3
memoService.ts
web/src/services/memoService.ts
+2
-1
tailwind.config.js
web/tailwind.config.js
+1
-0
No files found.
web/src/components/MemoCardDialog.tsx
View file @
2136a954
...
...
@@ -35,8 +35,12 @@ const MemoCardDialog: React.FC<Props> = (props: Props) => {
const
matchedArr
=
[...
memo
.
content
.
matchAll
(
MEMO_LINK_REG
)];
for
(
const
matchRes
of
matchedArr
)
{
if
(
matchRes
&&
matchRes
.
length
===
3
)
{
const
id
=
matchRes
[
2
];
const
memoTemp
=
memoService
.
getMemoById
(
Number
(
id
));
const
id
=
Number
(
matchRes
[
2
]);
if
(
id
===
memo
.
id
)
{
continue
;
}
const
memoTemp
=
memoService
.
getMemoById
(
id
);
if
(
memoTemp
)
{
linkMemos
.
push
({
...
memoTemp
,
...
...
@@ -51,6 +55,7 @@ const MemoCardDialog: React.FC<Props> = (props: Props) => {
const
linkedMemos
=
await
memoService
.
getLinkedMemos
(
memo
.
id
);
setLinkedMemos
(
linkedMemos
.
filter
((
m
)
=>
m
.
rowStatus
===
"NORMAL"
&&
m
.
id
!==
memo
.
id
)
.
sort
((
a
,
b
)
=>
utils
.
getTimeStampByDate
(
b
.
createdTs
)
-
utils
.
getTimeStampByDate
(
a
.
createdTs
))
.
map
((
m
)
=>
({
...
m
,
...
...
web/src/less/editor.less
View file @
2136a954
...
...
@@ -9,7 +9,6 @@
min-height: 40px;
max-height: 300px;
.pretty-scroll-bar(2px, 0);
z-index: 1;
&::placeholder {
padding-left: 2px;
...
...
@@ -49,7 +48,7 @@
}
> .tag-list {
@apply hidden flex-col justify-start items-start absolute top-6 left-0 mt-1 p-1 z-1
0
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-1 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/home.less
View file @
2136a954
@import "./mixin.less";
.page-wrapper.home {
@apply relative top-0 w-full h-screen overflow-y-auto;
@apply relative top-0 w-full h-screen overflow-y-auto
overflow-x-hidden
;
background-color: #f6f5f4;
> .page-container {
@apply relative w-full min-h-screen mx-auto flex flex-row justify-center items-start;
@apply relative w-full min-h-screen mx-auto flex flex-row justify-
start sm:justify-
center items-start;
>
.sidebar-wrapper
{
>
.sidebar-wrapper
{
@apply flex-shrink-0;
}
> .memos-wrapper {
@apply relative w-full max-w-2xl min-h-full
overflow-x-hidden
flex flex-col justify-start items-start px-4 sm:pr-6;
@apply relative w-full max-w-2xl min-h-full flex flex-col justify-start items-start px-4 sm:pr-6;
> .memos-editor-wrapper {
@apply sticky top-0 w-full h-full flex flex-col justify-start items-start z-1;
background-color: #f6f5f4;
}
}
}
}
web/src/less/memo.less
View file @
2136a954
...
...
@@ -23,7 +23,7 @@
@apply flex flex-row justify-end items-center relative flex-shrink-0;
> .more-action-btns-wrapper {
@apply hidden flex-col justify-start items-center absolute top-2 -right-4
z-10
flex-nowrap hover:flex p-3;
@apply hidden flex-col justify-start items-center absolute top-2 -right-4 flex-nowrap hover:flex p-3;
> .more-action-btns-container {
@apply w-28 h-auto p-1 whitespace-nowrap rounded-lg bg-white;
...
...
web/src/less/memos-header.less
View file @
2136a954
...
...
@@ -2,15 +2,13 @@
.section-header-container,
.memos-header-container {
.flex(row, space-between, center);
@apply w-full h-10 flex-nowrap mt-4 mb-2 shrink-0;
@apply sticky top-4 flex flex-row justify-between items-center w-full h-10 flex-nowrap mt-4 mb-2 shrink-0 z-1;
> .title-container {
@apply flex flex-row justify-start items-center mr-2 shrink-0 overflow-hidden;
> .action-btn {
@apply flex sm:hidden flex-row justify-center items-center w-6 h-6 mr-1 shrink-0;
background-color: unset;
@apply flex sm:hidden flex-row justify-center items-center w-6 h-6 mr-1 shrink-0 bg-transparent;
> .icon-img {
@apply w-5 h-auto;
...
...
@@ -18,12 +16,11 @@
}
> .title-text {
@apply font-bold text-lg leading-10 mr-2 text-ellipsis shrink-0 cursor-pointer overflow-hidden;
color: @text-black;
@apply font-bold text-lg leading-10 mr-2 text-ellipsis shrink-0 cursor-pointer overflow-hidden text-gray-700;
}
}
> .btns-container {
.flex(row, flex-end, center)
;
@apply flex flex-row justify-end items-center
;
}
}
web/src/less/preview-image-dialog.less
View file @
2136a954
...
...
@@ -20,12 +20,12 @@
}
> .img-container {
@apply w-full h-full flex flex-col justify-center items-center;
@apply w-full h-full
p-4
flex flex-col justify-center items-center;
background-color: unset;
.hide-scroll-bar();
> img {
@apply h-auto w-auto max-w-full max-h-full
p-4
;
@apply h-auto w-auto max-w-full max-h-full
shadow
;
}
}
}
...
...
web/src/less/share-memo-image-dialog.less
View file @
2136a954
...
...
@@ -40,8 +40,7 @@
@apply w-96 max-w-full h-auto select-none relative flex flex-col justify-start items-start;
> .memo-shortcut-img {
@apply absolute top-0 left-0 w-full h-auto rounded-b-lg;
z-index: 1;
@apply absolute top-0 left-0 w-full h-auto rounded-b-lg z-10;
}
> .time-text {
...
...
web/src/less/shortcut-list.less
View file @
2136a954
...
...
@@ -83,7 +83,7 @@
}
> .action-btns-wrapper {
@apply flex-col justify-start items-start absolute top-6 right-0 w-auto h-auto px-4 pt-3 hidden z-1
0
;
@apply flex-col justify-start items-start absolute top-6 right-0 w-auto h-auto px-4 pt-3 hidden z-1;
> .action-btns-container {
@apply flex flex-col justify-start items-start w-24 h-auto p-1 whitespace-nowrap rounded-md bg-white shadow;
...
...
web/src/pages/Home.tsx
View file @
2136a954
...
...
@@ -37,9 +37,11 @@ function Home() {
<
div
className=
"page-container"
>
<
Sidebar
/>
<
main
className=
"memos-wrapper"
>
<
MemosHeader
/>
<
MemoEditor
/>
<
MemoFilter
/>
<
div
className=
"memos-editor-wrapper"
>
<
MemosHeader
/>
<
MemoEditor
/>
<
MemoFilter
/>
</
div
>
<
MemoList
/>
</
main
>
</
div
>
...
...
web/src/services/memoService.ts
View file @
2136a954
...
...
@@ -48,7 +48,8 @@ const memoService = {
getLinkedMemos
:
async
(
memoId
:
MemoId
):
Promise
<
Memo
[]
>
=>
{
const
{
memos
}
=
memoService
.
getState
();
return
memos
.
filter
((
m
)
=>
m
.
content
.
includes
(
`
${
memoId
}
`
));
const
regex
=
new
RegExp
(
`[@(.+?)](
${
memoId
}
)`
);
return
memos
.
filter
((
m
)
=>
m
.
content
.
match
(
regex
));
},
createMemo
:
async
(
memoCreate
:
MemoCreate
)
=>
{
...
...
web/tailwind.config.js
View file @
2136a954
...
...
@@ -19,6 +19,7 @@ module.exports = {
180
:
"45rem"
,
},
zIndex
:
{
1
:
"1"
,
100
:
"100"
,
1000
:
"1000"
,
},
...
...
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