From 2ee3eaed0e21d0678f8bab4e8cbf466b52363864 Mon Sep 17 00:00:00 2001 From: Jixun Wu 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}