Skip to content

Conversation

@alecshoppe
Copy link

Summary

[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:

<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

  • The changes to the "Readme" file(if needed)
  • The changes not breaking any old rule of the library or usage

@Muhammadsaqib11
Copy link

Muhammadsaqib11 commented Sep 27, 2023

i am adding message object wiith all fields but it doesn,t have any kind of effect on it.
@alecshoppe

@KarimMokhtar
Copy link
Owner

@alecshoppe I suggest, add each field as prop better

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants