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
e32a585b
Commit
e32a585b
authored
May 05, 2024
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: update resource dashboard
parent
dfc0889a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
13 deletions
+3
-13
UploadResourceButton.tsx
...mponents/MemoEditor/ActionButton/UploadResourceButton.tsx
+1
-1
ResourceIcon.tsx
web/src/components/ResourceIcon.tsx
+1
-1
Resources.tsx
web/src/pages/Resources.tsx
+1
-11
No files found.
web/src/components/MemoEditor/ActionButton/UploadResourceButton.tsx
View file @
e32a585b
...
...
@@ -66,7 +66,7 @@ const UploadResourceButton = () => {
return
(
<
IconButton
size=
"sm"
>
<
Icon
.
Image
className=
"w-5 h-5 mx-auto"
/>
<
Icon
.
Paperclip
className=
"w-5 h-5 mx-auto"
/>
<
input
className=
"absolute inset-0 w-full h-full opacity-0 cursor-pointer"
ref=
{
fileInputRef
}
...
...
web/src/components/ResourceIcon.tsx
View file @
e32a585b
...
...
@@ -27,7 +27,7 @@ const ResourceIcon = (props: Props) => {
return
(
<
SquareDiv
className=
{
clsx
(
className
,
"flex items-center justify-center overflow-clip"
)
}
>
<
img
className=
"min-w-full min-h-full object-cover
border rounded dark:border-none
"
className=
"min-w-full min-h-full object-cover"
src=
{
resource
.
externalLink
?
resourceUrl
:
resourceUrl
+
"?thumbnail=1"
}
onClick=
{
()
=>
showPreviewImageDialog
(
resourceUrl
)
}
decoding=
"async"
...
...
web/src/pages/Resources.tsx
View file @
e32a585b
import
{
Divider
,
IconButton
,
Input
,
Tooltip
}
from
"@mui/joy"
;
import
{
includes
}
from
"lodash-es"
;
import
{
useEffect
,
useState
}
from
"react"
;
import
{
Link
}
from
"react-router-dom"
;
import
{
showCommonDialog
}
from
"@/components/Dialog/CommonDialog"
;
import
Empty
from
"@/components/Empty"
;
import
Icon
from
"@/components/Icon"
;
...
...
@@ -10,7 +9,7 @@ import ResourceIcon from "@/components/ResourceIcon";
import
{
resourceServiceClient
}
from
"@/grpcweb"
;
import
useLoading
from
"@/hooks/useLoading"
;
import
i18n
from
"@/i18n"
;
import
{
extractMemoIdFromName
,
useMemoStore
}
from
"@/store/v1"
;
import
{
useMemoStore
}
from
"@/store/v1"
;
import
{
Resource
}
from
"@/types/proto/api/v1/resource_service"
;
import
{
useTranslate
}
from
"@/utils/i18n"
;
...
...
@@ -118,7 +117,6 @@ const Resources = () => {
</
div
>
<
div
className=
"w-full max-w-[calc(100%-4rem)] sm:max-w-[calc(100%-6rem)] flex flex-row justify-start items-start gap-4 flex-wrap"
>
{
resources
.
map
((
resource
)
=>
{
const
relatedMemo
=
resource
.
memo
?
memoStore
.
getMemoByName
(
resource
.
memo
)
:
null
;
return
(
<
div
key=
{
resource
.
name
}
className=
"w-24 sm:w-32 h-auto flex flex-col justify-start items-start"
>
<
div
className=
"w-24 h-24 flex justify-center items-center sm:w-32 sm:h-32 border dark:border-zinc-900 overflow-clip rounded-xl cursor-pointer hover:shadow hover:opacity-80"
>
...
...
@@ -126,14 +124,6 @@ const Resources = () => {
</
div
>
<
div
className=
"w-full max-w-full flex flex-row justify-between items-center mt-1 px-1"
>
<
p
className=
"text-xs shrink text-gray-400 truncate"
>
{
resource
.
filename
}
</
p
>
{
relatedMemo
&&
(
<
Link
className=
"shrink-0 text-xs ml-1 text-gray-400 hover:underline hover:text-blue-600"
to=
{
`/m/${relatedMemo.uid}`
}
>
#
{
extractMemoIdFromName
(
relatedMemo
.
name
)
}
</
Link
>
)
}
</
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