From 373dc04a6b93cae2f26274acfdcf1abf93833351 Mon Sep 17 00:00:00 2001 From: Fedor Katurov Date: Wed, 14 Sep 2022 16:41:57 +0700 Subject: [PATCH] type button for comment attach buttons --- .../comment/CommentFormAttachButtons/index.tsx | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/components/comment/CommentFormAttachButtons/index.tsx b/src/components/comment/CommentFormAttachButtons/index.tsx index a2888a5e..adc275c8 100644 --- a/src/components/comment/CommentFormAttachButtons/index.tsx +++ b/src/components/comment/CommentFormAttachButtons/index.tsx @@ -10,26 +10,32 @@ interface IProps { const CommentFormAttachButtons: FC = ({ onUpload }) => { const onInputChange = useCallback( - event => { + (event) => { event.preventDefault(); - const files = Array.from(event.target?.files as File[]).filter((file: File) => - COMMENT_FILE_TYPES.includes(file.type) + const files = Array.from(event.target?.files as File[]).filter( + (file: File) => COMMENT_FILE_TYPES.includes(file.type), ); if (!files || !files.length) return; onUpload(files); }, - [onUpload] + [onUpload], ); return ( - -