Skip to content
This repository has been archived by the owner on Nov 19, 2018. It is now read-only.

Allow <Status> component's text object to contain properties with component/node values #170

Open
rnicholus opened this issue Dec 21, 2017 · 0 comments

Comments

@rnicholus
Copy link
Member

rnicholus commented Dec 21, 2017

...instead of just strings, that way you could do something like this:

const statusText = {
  upload_failed: <span>Failure <img src='red-x.png'/></span>,
  upload_successful: <span>Success! <img src='green-checkbox.png'/></span>,
  ...
}

<Status text={ statusText} />

The above would easily allow images/icons to be part of the status message. Additionally, if you use something like react-intl, this makes it a bit less awkward (IMHO) to provide translatable text:

const statusText = {
  upload_failed: <FormattedMessage id='Uploader.failed' />,
  ...
}
@rnicholus rnicholus changed the title Allow <Status> component's text property to contain properties with component/node values Allow <Status> component's text object to contain properties with component/node values Dec 21, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant