From 4748456ad1a3d9f6f3e80daf95139d82121d0846 Mon Sep 17 00:00:00 2001 From: Sam Haakman Date: Thu, 13 Apr 2023 12:39:10 +1000 Subject: [PATCH] added prop for dropzone notification --- src/components/ImageDropzone.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/ImageDropzone.tsx b/src/components/ImageDropzone.tsx index bef1f62..6029d75 100644 --- a/src/components/ImageDropzone.tsx +++ b/src/components/ImageDropzone.tsx @@ -14,6 +14,8 @@ export type ImageDropzoneProps = { */ accept?: string | string[]; maxNumberOfFiles?: number; + /** Change the text that appears when dragging a file over the dropzone */ + dragNotification?: string | React.ReactNode; }; export const ImageDropzone = ({ @@ -23,6 +25,7 @@ export const ImageDropzone = ({ accept, multiple, disabled, + dragNotification = 'Drag your files here to add to your post', }: PropsWithChildren) => { const handleDrop = useCallback( (accepted: File[]) => { @@ -72,7 +75,7 @@ export const ImageDropzone = ({ fillRule="nonzero" /> -

Drag your files here to add to your post

+

{dragNotification}

{children}