react-drop-n-crop icon indicating copy to clipboard operation
react-drop-n-crop copied to clipboard

Change the message content?

Open ghost opened this issue 7 years ago • 4 comments

It's a pretty good. But is there anyway to custom the content message for localization purpose? Thanks!

ghost avatar Apr 05 '18 17:04 ghost

Not currently!

This would be a pretty easy update though - we can add an optional prop called customMessages that takes a shape like this:

{
  instructions: 'Drag-n-drop a file or click to add an image',
  acceptedFileTypes: 'Accepted file types',
  maxFileSize: 'Max file size',
  fileTypeErrorMessage: 'Invalid file type',
  fileSizeErrorMessage: 'File size must be less than $BYTES',
}

then update the code to use those messages if provided

spruce-bruce avatar Apr 05 '18 18:04 spruce-bruce

I've seen your source code and solved this already. I've also add clear image feature and custom error messages. Can I contribute?

ghost avatar Apr 05 '18 19:04 ghost

Sure submit a PR and we'll take a look!

spruce-bruce avatar Apr 05 '18 20:04 spruce-bruce

Is this feature not available at master branch yet? Only in v0.3.0 branch so far? Edit: Hey after looking at the source code I realized you have a props known as "instructions" which allow user to change the content inside the "Drop n Crop" box! Perhaps you can add this to the documentation.

mkc2019 avatar Apr 23 '21 02:04 mkc2019