From 6de268909bcef3f98488fa912c1848ee959655f2 Mon Sep 17 00:00:00 2001 From: Roland Date: Wed, 15 Feb 2023 21:30:12 -0700 Subject: [PATCH] Using PreviewLink for file tables. --- app/src/components/Files.js | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/app/src/components/Files.js b/app/src/components/Files.js index caac113f..0ac05793 100644 --- a/app/src/components/Files.js +++ b/app/src/components/Files.js @@ -13,7 +13,6 @@ import { } from "semantic-ui-react"; import { CardGroupCentered, - CardLink, CardPosterLink, cardTitleWrapper, ExternalCardLink, @@ -182,26 +181,23 @@ function ImageRowCells({file}) { } // Fragment for SelectableRow - return ( + return
{poster}
- +

{textEllipsis(file.title || file.stem || file.path)}

-
+
-
) +
} export function EbookRowCells({file}) { const {ebook} = file; - const downloadUrl = `/download/${encodeURIComponent(file.path)}`; - const viewerUrl = file['mimetype'].startsWith('application/epub') ? `/epub.html?url=${downloadUrl}` : null; - let cover = ; if (ebook && ebook.cover_path) { const coverSrc = `/media/${encodeURIComponent(ebook.cover_path)}`; @@ -209,16 +205,16 @@ export function EbookRowCells({file}) { } // Fragment for SelectableRow - return ( + return
{cover}
- + {textEllipsis(ebook.title || file.title)} - + -
) +
} function FileRow({file}) { @@ -235,15 +231,14 @@ function FileRow({file}) { } else if (isEbookType) { return ; } - const onDownloadFile = async () => window.open(`/media/${file.key}`); // Fragment for SelectableRow return
- onDownloadFile()}> - {textEllipsis(file.title)} + + {textEllipsis(file.title)}
}