From d90964501fae1d65a1feb1381a91687038138910 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Curda?= Date: Tue, 22 Oct 2024 13:16:59 +0200 Subject: [PATCH] fixup! Fix(web-react): FileUploaderInput className #DS-1508 --- .../src/app/fileuploader.tsx | 69 ------------------- .../next-with-app-router/src/app/page.tsx | 4 +- 2 files changed, 2 insertions(+), 71 deletions(-) delete mode 100644 examples/next-with-app-router/src/app/fileuploader.tsx diff --git a/examples/next-with-app-router/src/app/fileuploader.tsx b/examples/next-with-app-router/src/app/fileuploader.tsx deleted file mode 100644 index 258a3aa1b9..0000000000 --- a/examples/next-with-app-router/src/app/fileuploader.tsx +++ /dev/null @@ -1,69 +0,0 @@ -'use client'; - -import { - FileUploader, - FileUploaderAttachment, - FileUploaderInput, - FileUploaderList, - SpiritFileUploaderAttachmentProps, - useFileQueue, -} from '@lmc-eu/spirit-web-react'; -import React, { useState } from 'react'; - -const FileuploaderTest = () => { - const [errorMessage, setErrorMessage] = useState<(string | Error)[]>([]); - - const { - fileQueue: fileQueueWarning, - addToQueue: addToQueueWarning, - clearQueue: clearQueueWarning, - onDismiss: onDismissWarning, - findInQueue: findInQueueWarning, - updateQueue: updateQueueWarning, - } = useFileQueue(); - - const attachmentComponent = ({ id, ...props }: SpiritFileUploaderAttachmentProps) => ( - - ); - - return ( - { - return addToQueueWarning(key, file); - }} - clearQueue={clearQueueWarning} - fileQueue={fileQueueWarning} - findInQueue={findInQueueWarning} - id="file-uploader-validation-states-warning" - onDismiss={onDismissWarning} - updateQueue={updateQueueWarning} - > - { - setErrorMessage((prevErrors) => [...prevErrors, error]); - }} - validationText={`${errorMessage.join(', ')}`} - validationState="warning" - isRequired - isMultiple - maxFileSize={51200} // 50 kb - // add onInput callback should solve issue if upload files by select them (not for drag and drop) - // onInput={() => setErrorMessage([])} - /> - - - ); -}; - -export default FileuploaderTest; diff --git a/examples/next-with-app-router/src/app/page.tsx b/examples/next-with-app-router/src/app/page.tsx index 9aaded621a..367b25b8ad 100644 --- a/examples/next-with-app-router/src/app/page.tsx +++ b/examples/next-with-app-router/src/app/page.tsx @@ -1,6 +1,6 @@ -import FileuploaderTest from '@/app/fileuploader'; +import { Heading } from '@lmc-eu/spirit-web-react'; import { NextPage } from 'next'; -const Home: NextPage = () => ; +const Home: NextPage = () => Spirit App Router; export default Home;