mirror of
https://github.com/usememos/memos.git
synced 2025-03-20 20:50:07 +01:00
chore: update resource dashboard
This commit is contained in:
parent
dfc0889a4f
commit
e32a585bbf
@ -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}
|
||||
|
@ -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"
|
||||
|
@ -1,7 +1,6 @@
|
||||
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>
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user