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
cfc55993
Commit
cfc55993
authored
Oct 14, 2023
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: cleanup less files
parent
c02f3c0a
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
54 additions
and
193 deletions
+54
-193
MemoFilter.tsx
web/src/components/MemoFilter.tsx
+22
-10
MemoList.tsx
web/src/components/MemoList.tsx
+5
-6
MemoResourceListView.tsx
web/src/components/MemoResourceListView.tsx
+10
-5
archived.less
web/src/less/archived.less
+0
-11
change-resource-filename-dialog.less
web/src/less/change-resource-filename-dialog.less
+0
-13
image.less
web/src/less/image.less
+0
-8
memo-content.less
web/src/less/memo-content.less
+0
-23
memo-filter.less
web/src/less/memo-filter.less
+0
-12
memo-list.less
web/src/less/memo-list.less
+0
-15
memo-resources.less
web/src/less/memo-resources.less
+0
-19
resources-selector-dialog.less
web/src/less/resources-selector-dialog.less
+0
-51
Archived.tsx
web/src/pages/Archived.tsx
+17
-20
No files found.
web/src/components/MemoFilter.tsx
View file @
cfc55993
...
@@ -4,7 +4,6 @@ import { getDateString } from "@/helpers/datetime";
...
@@ -4,7 +4,6 @@ import { getDateString } from "@/helpers/datetime";
import
{
useFilterStore
}
from
"@/store/module"
;
import
{
useFilterStore
}
from
"@/store/module"
;
import
{
useTranslate
}
from
"@/utils/i18n"
;
import
{
useTranslate
}
from
"@/utils/i18n"
;
import
Icon
from
"./Icon"
;
import
Icon
from
"./Icon"
;
import
"@/less/memo-filter.less"
;
const
MemoFilter
=
()
=>
{
const
MemoFilter
=
()
=>
{
const
t
=
useTranslate
();
const
t
=
useTranslate
();
...
@@ -19,34 +18,44 @@ const MemoFilter = () => {
...
@@ -19,34 +18,44 @@ const MemoFilter = () => {
}
, [location]);
}
, [location]);
return (
return (
<
div
className=
{
`filter-query-container ${showFilter ? "" : "!hidden"}`
}
>
<
div
className=
{
`flex flex-row justify-start items-start w-full flex-wrap px-2 pb-2 text-sm font-mono leading-7 dark:text-gray-300 ${
showFilter ? "" : "!hidden"
}`
}
>
<
span
className=
"mx-2 text-gray-400"
>
{
t
(
"common.filter"
)
}
:
</
span
>
<
span
className=
"mx-2 text-gray-400"
>
{
t
(
"common.filter"
)
}
:
</
span
>
<
div
<
div
className=
{
"filter-item-container "
+
(
tagQuery
?
""
:
"!hidden"
)
}
className=
{
"max-w-xs flex flex-row justify-start items-center px-2 mr-2 cursor-pointer dark:text-gray-300 bg-gray-200 dark:bg-zinc-700 rounded whitespace-nowrap truncate hover:line-through "
+
(
tagQuery
?
""
:
"!hidden"
)
}
onClick=
{
()
=>
{
onClick=
{
()
=>
{
filterStore
.
setTagFilter
(
undefined
);
filterStore
.
setTagFilter
(
undefined
);
}
}
}
}
>
>
<
Icon
.
Tag
className=
"
icon-text
"
/>
{
tagQuery
}
<
Icon
.
Tag
className=
"
w-4 h-auto mr-1 text-gray-500 dark:text-gray-400
"
/>
{
tagQuery
}
<
Icon
.
X
className=
"w-4 h-auto ml-1 opacity-40"
/>
<
Icon
.
X
className=
"w-4 h-auto ml-1 opacity-40"
/>
</
div
>
</
div
>
<
div
<
div
className=
{
"filter-item-container "
+
(
visibility
?
""
:
"!hidden"
)
}
className=
{
"max-w-xs flex flex-row justify-start items-center px-2 mr-2 cursor-pointer dark:text-gray-300 bg-gray-200 dark:bg-zinc-700 rounded whitespace-nowrap truncate hover:line-through "
+
(
visibility
?
""
:
"!hidden"
)
}
onClick=
{
()
=>
{
onClick=
{
()
=>
{
filterStore
.
setMemoVisibilityFilter
(
undefined
);
filterStore
.
setMemoVisibilityFilter
(
undefined
);
}
}
}
}
>
>
<
Icon
.
Eye
className=
"
icon-text
"
/>
{
visibility
}
<
Icon
.
Eye
className=
"
w-4 h-auto mr-1 text-gray-500 dark:text-gray-400
"
/>
{
visibility
}
<
Icon
.
X
className=
"w-4 h-auto ml-1 opacity-40"
/>
<
Icon
.
X
className=
"w-4 h-auto ml-1 opacity-40"
/>
</
div
>
</
div
>
{
duration
&&
duration
.
from
<
duration
.
to
?
(
{
duration
&&
duration
.
from
<
duration
.
to
?
(
<
div
<
div
className=
"
filter-item-container
"
className=
"
max-w-xs flex flex-row justify-start items-center px-2 mr-2 cursor-pointer dark:text-gray-300 bg-gray-200 dark:bg-zinc-700 rounded whitespace-nowrap truncate hover:line-through
"
onClick=
{
()
=>
{
onClick=
{
()
=>
{
filterStore
.
setFromAndToFilter
();
filterStore
.
setFromAndToFilter
();
}
}
}
}
>
>
<
Icon
.
Calendar
className=
"
icon-text
"
/>
<
Icon
.
Calendar
className=
"
w-4 h-auto mr-1 text-gray-500 dark:text-gray-400
"
/>
{
t
(
"common.filter-period"
,
{
{
t
(
"common.filter-period"
,
{
from
:
getDateString
(
duration
.
from
),
from
:
getDateString
(
duration
.
from
),
to
:
getDateString
(
duration
.
to
),
to
:
getDateString
(
duration
.
to
),
...
@@ -56,12 +65,15 @@ const MemoFilter = () => {
...
@@ -56,12 +65,15 @@ const MemoFilter = () => {
</
div
>
</
div
>
)
:
null
}
)
:
null
}
<
div
<
div
className=
{
"filter-item-container "
+
(
textQuery
?
""
:
"!hidden"
)
}
className=
{
"max-w-xs flex flex-row justify-start items-center px-2 mr-2 cursor-pointer dark:text-gray-300 bg-gray-200 dark:bg-zinc-700 rounded whitespace-nowrap truncate hover:line-through "
+
(
textQuery
?
""
:
"!hidden"
)
}
onClick=
{
()
=>
{
onClick=
{
()
=>
{
filterStore
.
setTextFilter
(
undefined
);
filterStore
.
setTextFilter
(
undefined
);
}
}
}
}
>
>
<
Icon
.
Search
className=
"
icon-text
"
/>
{
textQuery
}
<
Icon
.
Search
className=
"
w-4 h-auto mr-1 text-gray-500 dark:text-gray-400
"
/>
{
textQuery
}
<
Icon
.
X
className=
"w-4 h-auto ml-1 opacity-40"
/>
<
Icon
.
X
className=
"w-4 h-auto ml-1 opacity-40"
/>
</
div
>
</
div
>
</
div
>
</
div
>
...
...
web/src/components/MemoList.tsx
View file @
cfc55993
...
@@ -9,7 +9,6 @@ import { useFilterStore, useMemoStore } from "@/store/module";
...
@@ -9,7 +9,6 @@ import { useFilterStore, useMemoStore } from "@/store/module";
import
{
useTranslate
}
from
"@/utils/i18n"
;
import
{
useTranslate
}
from
"@/utils/i18n"
;
import
Empty
from
"./Empty"
;
import
Empty
from
"./Empty"
;
import
Memo
from
"./Memo"
;
import
Memo
from
"./Memo"
;
import
"@/less/memo-list.less"
;
const
MemoList
:
React
.
FC
=
()
=>
{
const
MemoList
:
React
.
FC
=
()
=>
{
const
t
=
useTranslate
();
const
t
=
useTranslate
();
...
@@ -131,17 +130,17 @@ const MemoList: React.FC = () => {
...
@@ -131,17 +130,17 @@ const MemoList: React.FC = () => {
}
;
}
;
return (
return (
<
div
className=
"
memo-list-containe
r"
>
<
div
className=
"
flex flex-col justify-start items-start w-full max-w-full overflow-y-scroll pb-28 hide-scrollba
r"
>
{
sortedMemos
.
map
((
memo
)
=>
(
{
sortedMemos
.
map
((
memo
)
=>
(
<
Memo
key=
{
`${memo.id}-${memo.displayTs}`
}
memo=
{
memo
}
lazyRendering
showVisibility
/>
<
Memo
key=
{
`${memo.id}-${memo.displayTs}`
}
memo=
{
memo
}
lazyRendering
showVisibility
/>
))
}
))
}
{
isFetching
?
(
{
isFetching
?
(
<
div
className=
"
status-text-container fetching-tip
"
>
<
div
className=
"
flex flex-col justify-start items-center w-full mt-2 mb-1
"
>
<
p
className=
"
status-text
"
>
{
t
(
"memo.fetching-data"
)
}
</
p
>
<
p
className=
"
text-sm text-gray-400 italic
"
>
{
t
(
"memo.fetching-data"
)
}
</
p
>
</
div
>
</
div
>
)
:
(
)
:
(
<
div
className=
"
status-text-container
"
>
<
div
className=
"
flex flex-col justify-start items-center w-full my-6
"
>
<
div
className=
"
status-text
"
>
<
div
className=
"
text-sm text-gray-400 italic
"
>
{
isComplete
?
(
{
isComplete
?
(
sortedMemos
.
length
===
0
&&
(
sortedMemos
.
length
===
0
&&
(
<
div
className=
"w-full mt-12 mb-8 flex flex-col justify-center items-center italic"
>
<
div
className=
"w-full mt-12 mb-8 flex flex-col justify-center items-center italic"
>
...
...
web/src/components/MemoResourceListView.tsx
View file @
cfc55993
...
@@ -5,7 +5,6 @@ import { getResourceType, getResourceUrl } from "@/utils/resource";
...
@@ -5,7 +5,6 @@ import { getResourceType, getResourceUrl } from "@/utils/resource";
import
MemoResource
from
"./MemoResource"
;
import
MemoResource
from
"./MemoResource"
;
import
showPreviewImageDialog
from
"./PreviewImageDialog"
;
import
showPreviewImageDialog
from
"./PreviewImageDialog"
;
import
SquareDiv
from
"./kit/SquareDiv"
;
import
SquareDiv
from
"./kit/SquareDiv"
;
import
"@/less/memo-resources.less"
;
interface
Props
{
interface
Props
{
resourceList
:
Resource
[];
resourceList
:
Resource
[];
...
@@ -77,14 +76,20 @@ const MemoResourceListView: React.FC<Props> = (props: Props) => {
...
@@ -77,14 +76,20 @@ const MemoResourceListView: React.FC<Props> = (props: Props) => {
</
div
>
</
div
>
))
}
))
}
<
div
className=
{
`
resource-wrapper
${className || ""}`
}
>
<
div
className=
{
`
w-full flex flex-col justify-start items-start
${className || ""}`
}
>
{
videoResourceList
.
length
>
0
&&
(
{
videoResourceList
.
length
>
0
&&
(
<
div
className=
"
images-
wrapper"
>
<
div
className=
"
w-full grid grid-cols-2 sm:grid-cols-3 gap-2 mt-2
wrapper"
>
{
videoResourceList
.
map
((
resource
)
=>
{
{
videoResourceList
.
map
((
resource
)
=>
{
const
url
=
getResourceUrl
(
resource
);
const
url
=
getResourceUrl
(
resource
);
return
(
return
(
<
SquareDiv
key=
{
resource
.
id
}
className=
"memo-resource"
>
<
SquareDiv
key=
{
resource
.
id
}
className=
"shadow rounded overflow-hidden hide-scrollbar"
>
<
video
preload=
"metadata"
crossOrigin=
"anonymous"
src=
{
absolutifyLink
(
url
)
}
controls
></
video
>
<
video
className=
"cursor-pointer w-full h-full object-contain bg-zinc-100 dark:bg-zinc-800"
preload=
"metadata"
crossOrigin=
"anonymous"
src=
{
absolutifyLink
(
url
)
}
controls
></
video
>
</
SquareDiv
>
</
SquareDiv
>
);
);
})
}
})
}
...
...
web/src/less/archived.less
deleted
100644 → 0
View file @
c02f3c0a
.archived-memo-page {
@apply w-full max-w-3xl min-h-full flex flex-col justify-start items-center pb-8 bg-zinc-100 dark:bg-zinc-800;
> .tip-text-container {
@apply w-full h-32 flex flex-col justify-center items-center;
}
> .archived-memos-container {
@apply w-full flex flex-col justify-start items-start;
}
}
web/src/less/change-resource-filename-dialog.less
deleted
100644 → 0
View file @
c02f3c0a
.change-resource-filename-dialog {
> .dialog-container {
@apply w-72;
> .dialog-content-container {
@apply flex flex-col justify-start items-start;
> .btns-container {
@apply flex flex-row justify-end items-center mt-2 w-full;
}
}
}
}
web/src/less/image.less
deleted
100644 → 0
View file @
c02f3c0a
.image-container {
@apply hide-scrollbar;
-webkit-tap-highlight-color: transparent;
> img {
@apply w-full h-auto;
}
}
web/src/less/memo-content.less
View file @
cfc55993
...
@@ -105,27 +105,4 @@
...
@@ -105,27 +105,4 @@
@apply my-1 dark:border-zinc-600;
@apply my-1 dark:border-zinc-600;
}
}
}
}
> .expand-btn-container {
@apply w-full relative flex flex-row justify-start items-center z-1;
> .btn {
@apply flex flex-row justify-start items-center pl-2 pr-1 py-1 my-2 text-xs rounded-lg border bg-gray-100 dark:bg-zinc-600 border-gray-200 dark:border-zinc-600 shadow hover:opacity-90 cursor-pointer;
&.expand-btn {
> .icon-img {
@apply rotate-90;
}
}
&.fold-btn {
> .icon-img {
@apply -rotate-90;
}
}
> .icon-img {
@apply w-4 h-auto ml-1 transition-all;
}
}
}
}
}
web/src/less/memo-filter.less
deleted
100644 → 0
View file @
c02f3c0a
.filter-query-container {
@apply flex flex-row justify-start items-start w-full flex-wrap px-2 pb-2 text-sm font-mono leading-7 dark:text-gray-300;
> .filter-item-container {
@apply flex flex-row justify-start items-center px-2 mr-2 cursor-pointer dark:text-gray-300 bg-gray-200 dark:bg-zinc-700 rounded whitespace-nowrap truncate hover:line-through;
max-width: 256px;
> .icon-text {
@apply w-4 h-auto mr-1 text-gray-500 dark:text-gray-400;
}
}
}
web/src/less/memo-list.less
deleted
100644 → 0
View file @
c02f3c0a
.memo-list-container {
@apply flex flex-col justify-start items-start w-full max-w-full overflow-y-scroll pb-28 hide-scrollbar;
> .status-text-container {
@apply flex flex-col justify-start items-center w-full my-6;
&.fetching-tip {
@apply mt-2 mb-1;
}
> .status-text {
@apply text-sm text-gray-400 italic;
}
}
}
web/src/less/memo-resources.less
deleted
100644 → 0
View file @
c02f3c0a
.resource-wrapper {
@apply w-full flex flex-col justify-start items-start;
> .images-wrapper {
@apply w-full grid grid-cols-2 sm:grid-cols-3 gap-2 mt-2;
> .memo-resource {
@apply shadow rounded overflow-hidden hide-scrollbar;
> img {
@apply cursor-pointer min-h-full w-auto min-w-full object-cover;
}
> video {
@apply cursor-pointer w-full h-full object-contain bg-zinc-100 dark:bg-zinc-800;
}
}
}
}
web/src/less/resources-selector-dialog.less
deleted
100644 → 0
View file @
c02f3c0a
.resources-selector-dialog {
@apply px-4;
> .dialog-container {
@apply w-112 max-w-full mb-8;
> .dialog-content-container {
@apply flex flex-col justify-start items-start w-full;
> .loading-text-container {
@apply flex flex-col justify-center items-center w-full h-32;
}
> .resource-table-container {
@apply flex flex-col justify-start items-start w-full;
> .fields-container {
@apply px-2 py-2 w-full grid grid-cols-7 border-b dark:border-b-gray-500;
> .field-text {
@apply font-mono text-gray-400;
}
}
> .tip-text {
@apply w-full text-center text-base my-6 mt-8;
}
> .resource-container {
@apply px-2 py-2 w-full grid grid-cols-7 dark:bg-zinc-700;
> .buttons-container {
@apply w-full flex flex-row justify-end items-center;
}
}
.field-text {
@apply w-full truncate text-base pr-2 last:pr-0;
&.name-text {
@apply col-span-4;
}
&.type-text {
@apply col-span-2;
}
}
}
}
}
}
web/src/pages/Archived.tsx
View file @
cfc55993
...
@@ -7,7 +7,6 @@ import MobileHeader from "@/components/MobileHeader";
...
@@ -7,7 +7,6 @@ import MobileHeader from "@/components/MobileHeader";
import
useLoading
from
"@/hooks/useLoading"
;
import
useLoading
from
"@/hooks/useLoading"
;
import
{
useFilterStore
,
useMemoStore
}
from
"@/store/module"
;
import
{
useFilterStore
,
useMemoStore
}
from
"@/store/module"
;
import
{
useTranslate
}
from
"@/utils/i18n"
;
import
{
useTranslate
}
from
"@/utils/i18n"
;
import
"@/less/archived.less"
;
const
Archived
=
()
=>
{
const
Archived
=
()
=>
{
const
t
=
useTranslate
();
const
t
=
useTranslate
();
...
@@ -38,25 +37,23 @@ const Archived = () => {
...
@@ -38,25 +37,23 @@ const Archived = () => {
return
(
return
(
<
section
className=
"w-full max-w-3xl min-h-full flex flex-col justify-start items-start px-4 sm:px-2 sm:pt-4 pb-8 bg-zinc-100 dark:bg-zinc-800"
>
<
section
className=
"w-full max-w-3xl min-h-full flex flex-col justify-start items-start px-4 sm:px-2 sm:pt-4 pb-8 bg-zinc-100 dark:bg-zinc-800"
>
<
MobileHeader
showSearch=
{
false
}
/>
<
MobileHeader
showSearch=
{
false
}
/>
<
div
className=
"archived-memo-page"
>
<
MemoFilter
/>
<
MemoFilter
/>
{
loadingState
.
isLoading
?
(
{
loadingState
.
isLoading
?
(
<
div
className=
"w-full h-32 flex flex-col justify-center items-center"
>
<
div
className=
"tip-text-container"
>
<
p
className=
"opacity-70"
>
{
t
(
"memo.fetching-data"
)
}
</
p
>
<
p
className=
"tip-text"
>
{
t
(
"memo.fetching-data"
)
}
</
p
>
</
div
>
</
div
>
)
:
archivedMemos
.
length
===
0
?
(
)
:
archivedMemos
.
length
===
0
?
(
<
div
className=
"w-full mt-16 mb-8 flex flex-col justify-center items-center italic"
>
<
div
className=
"w-full mt-16 mb-8 flex flex-col justify-center items-center italic"
>
<
Empty
/>
<
Empty
/>
<
p
className=
"mt-4 text-gray-600 dark:text-gray-400"
>
{
t
(
"message.no-data"
)
}
</
p
>
<
p
className=
"mt-4 text-gray-600 dark:text-gray-400"
>
{
t
(
"message.no-data"
)
}
</
p
>
</
div
>
</
div
>
)
:
(
)
:
(
<
div
className=
"w-full flex flex-col justify-start items-start"
>
<
div
className=
"archived-memos-container"
>
{
archivedMemos
.
map
((
memo
)
=>
(
{
archivedMemos
.
map
((
memo
)
=>
(
<
ArchivedMemo
key=
{
`${memo.id}-${memo.updatedTs}`
}
memo=
{
memo
}
/>
<
ArchivedMemo
key=
{
`${memo.id}-${memo.updatedTs}`
}
memo=
{
memo
}
/>
))
}
))
}
</
div
>
</
div
>
)
}
)
}
</
div
>
</
section
>
</
section
>
);
);
};
};
...
...
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