From 9aba8f9bd701cc7b86432ed0eecbee535b7eb3c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=B2=81=E6=A0=91=E4=BA=BA?= Date: Mon, 15 May 2023 00:41:39 +0100 Subject: [PATCH] feat: basic responsive UI --- src/features/file-listing/FileRow.tsx | 35 +++++++++++++++++++-------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/src/features/file-listing/FileRow.tsx b/src/features/file-listing/FileRow.tsx index 9dd68b0..b08f8c1 100644 --- a/src/features/file-listing/FileRow.tsx +++ b/src/features/file-listing/FileRow.tsx @@ -24,7 +24,8 @@ interface FileRowProps { export function FileRow({ id, file }: FileRowProps) { const isDecrypted = file.state === ProcessState.COMPLETE; - const decryptedName = file.fileName.replace(/\.[a-z\d]{3,6}$/, '') + '.' + file.ext; + const nameWithoutExt = file.fileName.replace(/\.[a-z\d]{3,6}$/, ''); + const decryptedName = nameWithoutExt + '.' + file.ext; const audioPlayerRef = useRef(null); const togglePlay = () => { @@ -44,23 +45,37 @@ export function FileRow({ id, file }: FileRowProps) { -
+
{file.metadata.cover && } {!file.metadata.cover && 暂无封面}
- - {file.metadata.name || file.fileName} + + {file.metadata.name || nameWithoutExt}