Light and simple Reactjs drag and drop files library to use with very flexible options to change, so you put whatever the design you want for your drop-area. Users can drag and drop or even select the file anywhere in the window.
MIT License
248
stars
91
forks
source link
feat: add messages prop to change some static texts #118
[What does this PR introduce?]
A way to change some static messages
Key Changes
add a hideTypes prop [BOOLEAN]: remove the UI for showing file types
add messages prop [MessagesType]: changes some statics texts
MessagesType {
disabled?: string // changes the disabled text
uploaded?: string // changes the uploaded underline text
upload_another?: string // changes the upload another text
error?: string // changes the generic error text
drop?: string // changes the drop here text (override the "hoverTitle")
upload?: string // changes the upload underline text
or_message?: string // changes the or text after upload underline text
}
In order to messages.upload and messages.or_message to work, you need to not declare the "label" like this:
Summary
[What does this PR introduce?] A way to change some static messages
Key Changes
In order to messages.upload and messages.or_message to work, you need to not declare the "label" like this:
<FileUploader handleChange={handleChangeFile} name="file" file={file} messages={{ disabled: 'Disabled image', uploaded: 'Upload done!', upload_another: 'Change file', error: 'Error, check file type and size', drop: 'Drop file here', upload: 'Choose image', or_message: 'or drag the file here' }} hideTypes types={["jpg", "png", "jpeg"]} />
Check List