From 8c17573e81ee6192e5061ce841b16c6b97ef0268 Mon Sep 17 00:00:00 2001 From: TheoryOfNekomata Date: Mon, 24 Jul 2023 12:38:14 +0800 Subject: [PATCH] Update fileselectblob enhanced Make layout consistent with enhanced fileselectblob components --- .../src/components/FileSelectBox/index.tsx | 70 +++++++++---------- .../src/pages/categories/blob/index.tsx | 13 +++- 2 files changed, 44 insertions(+), 39 deletions(-) diff --git a/categories/blob/react/src/components/FileSelectBox/index.tsx b/categories/blob/react/src/components/FileSelectBox/index.tsx index 2d4ad3f..c6ec584 100644 --- a/categories/blob/react/src/components/FileSelectBox/index.tsx +++ b/categories/blob/react/src/components/FileSelectBox/index.tsx @@ -359,53 +359,49 @@ export const FileSelectBox = React.forwardRef
-
- {multiple - && ( -
-
- {Array.from(fileList ?? []).map((file) => ( -
- -
- ))} -
-
- )} - {!multiple - && Array.from(fileList ?? []).map((file) => ( -
-
+ {multiple + && ( +
+
+ {Array.from(fileList ?? []).map((file) => (
+ ))} +
+
+ )} + {!multiple + && Array.from(fileList ?? []).map((file) => ( +
+
+
+
- ))} -
+
+ ))}
diff --git a/showcases/web-kitchensink-reactnext/src/pages/categories/blob/index.tsx b/showcases/web-kitchensink-reactnext/src/pages/categories/blob/index.tsx index c4cd673..96ccf9c 100644 --- a/showcases/web-kitchensink-reactnext/src/pages/categories/blob/index.tsx +++ b/showcases/web-kitchensink-reactnext/src/pages/categories/blob/index.tsx @@ -13,7 +13,16 @@ const BlobPage: NextPage = () => { name="file" border placeholder="Select a file" - previewComponent={() => null} + onChange={(e) => { console.log('change', e.currentTarget.name, e.currentTarget, e.currentTarget.files)}} + /> + + + { console.log('change', e.currentTarget.name, e.currentTarget, e.currentTarget.files)}} /> @@ -30,7 +39,7 @@ const BlobPage: NextPage = () => { onChange={(e) => { console.log('change', e.currentTarget.name, e.currentTarget, e.currentTarget.files)}} /> - +