From 4a097bad9d3fc6761aa4cc555c97fd9c7886db31 Mon Sep 17 00:00:00 2001 From: TerryM Date: Fri, 29 May 2026 17:58:30 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=83=AD=E9=97=A8=E6=A6=9C=E5=8D=95?= =?UTF-8?q?=E7=A7=BB=E9=99=A4=E9=A2=84=E8=A7=88=E6=8C=89=E9=92=AE,?= =?UTF-8?q?=E4=BB=85=E4=BF=9D=E7=95=99=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.8 (1M context) --- src/components/PopularRankList.tsx | 32 +----------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/src/components/PopularRankList.tsx b/src/components/PopularRankList.tsx index afd8598..6d0f503 100644 --- a/src/components/PopularRankList.tsx +++ b/src/components/PopularRankList.tsx @@ -1,7 +1,6 @@ import { Archive, Download, - Eye, File, FileText, Image as ImageIcon, @@ -20,9 +19,7 @@ import { resourceTypeLabel } from "../resourceTypeLabels"; import { cleanCategoryDisplayName } from "../utils/categoryDisplay"; import { formatDateYmd } from "../utils/format"; import { postToResource } from "../utils/postResourceAdapter"; -import type { Attachment, Post } from "../types/post"; -import { useLightbox } from "./messageStream/overlays/ImageLightbox"; -import { useVideoPlayer } from "./messageStream/overlays/VideoPlayer"; +import type { Post } from "../types/post"; import { downloadAttachment } from "./messageStream/utils/downloadFile"; import { useToast } from "./Toast"; @@ -94,8 +91,6 @@ function PopularRankRow({ }) { const { t, lang } = useI18n(); const navigate = useNavigate(); - const { openLightbox } = useLightbox(); - const { openVideo } = useVideoPlayer(); const { showToast } = useToast(); const [isDownloading, setIsDownloading] = useState(false); const [coverFailed, setCoverFailed] = useState(false); @@ -104,22 +99,6 @@ function PopularRankRow({ const cover = r.coverImage && !coverFailed ? assetUrl(r.coverImage) : ""; const isTop3 = index < MEDALS.length; - const first: Attachment | undefined = post.attachments[0]; - const imageAttachments = post.attachments.filter((a) => a.kind === "image"); - - const handlePreview = () => { - if (first?.kind === "video") { - openVideo(first); - return; - } - if (imageAttachments.length > 0) { - openLightbox(imageAttachments, 0, r.title, post.id); - return; - } - // Documents / links have no inline overlay — fall through to the detail page. - navigate(`/resource/${post.id}`); - }; - const handleDownload = async () => { if (isDownloading || !r.downloadPostId || !r.downloadAttachmentId) return; setIsDownloading(true); @@ -185,15 +164,6 @@ function PopularRankRow({
- {r.isDownloadable ? (