From 168c2320ab1362f428b2cc3e757ba53d3b2dea7a Mon Sep 17 00:00:00 2001 From: goodm2ice Date: Tue, 22 Feb 2022 15:28:55 +0500 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=B2=D0=BE=D0=B7=D0=BC=D0=BE=D0=B6=D0=BD=D0=BE?= =?UTF-8?q?=D1=81=D1=82=D1=8C=20=D0=B1=D0=BB=D0=BE=D0=BA=D0=B8=D1=80=D0=BE?= =?UTF-8?q?=D0=B2=D0=BA=D0=B8=20=D0=B7=D0=B0=D0=B3=D1=80=D1=83=D0=B7=D0=BA?= =?UTF-8?q?=D0=B8=20=D1=84=D0=B0=D0=B9=D0=BB=D0=B0=20=D0=B8=20=D0=B2=D1=8B?= =?UTF-8?q?=D0=B2=D0=BE=D0=B4=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B8=20?= =?UTF-8?q?=D0=B7=D0=B0=D0=B3=D1=80=D1=83=D0=B7=D0=BA=D0=B8=20=D0=B2=20?= =?UTF-8?q?=D0=BA=D0=BE=D0=BD=D1=81=D0=BE=D0=BB=D1=8C=20=D0=B2=20=D1=80?= =?UTF-8?q?=D0=B5=D0=B6=D0=B8=D0=BC=D0=B5=20=D1=80=D0=B0=D0=B7=D1=80=D0=B0?= =?UTF-8?q?=D0=B1=D0=BE=D1=82=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/UploadForm.jsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/UploadForm.jsx b/src/components/UploadForm.jsx index 272e365..0fd4ae9 100644 --- a/src/components/UploadForm.jsx +++ b/src/components/UploadForm.jsx @@ -5,7 +5,7 @@ import { UploadOutlined } from '@ant-design/icons' import { upload } from './factory' import { ErrorFetch } from './ErrorFetch' -export const UploadForm = memo(({ url, accept, style, formData, onUploadStart, onUploadSuccess, onUploadComplete, onUploadError }) => { +export const UploadForm = memo(({ url, disabled, accept, style, formData, onUploadStart, onUploadSuccess, onUploadComplete, onUploadError }) => { const [fileList, setfileList] = useState([]) const handleFileSend = async () => { @@ -27,6 +27,8 @@ export const UploadForm = memo(({ url, accept, style, formData, onUploadStart, o onUploadSuccess?.() } } catch(error) { + if(process.env.NODE_ENV === 'development') + console.error(error) onUploadError?.(error) } finally { setfileList([]) @@ -40,10 +42,11 @@ export const UploadForm = memo(({ url, accept, style, formData, onUploadStart, o setfileList(props.fileList)} > - +