-
Notifications
You must be signed in to change notification settings - Fork 252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom image per alert type #120
Comments
@lucianomlima If you want you can use |
I know... I use custom type but it would be interesting to be able to have custom image for alert types. |
true something like the errorImageSrc, etc, it would make it a bit easier. I welcome a PR. |
I can help with PR but I'm not familiar with TDD and this can reduce coverage for this component. |
No worries on the testing I will follow up with a tiny patch on that end. Also, thanks. |
Ok! I try to send a PR |
getSourceForType(type) {
switch (type) {
case 'info':
return this.props.infoImageSrc || require('./assets/info.png');
case 'warn':
return this.props.warnImageSrc || require('./assets/warn.png');
case 'error':
return this.props.errorImageSrc || require('./assets/error.png');
case 'success':
return this.props.successImageSrc || require('./assets/success.png');
default:
return this.props.imageSrc;
}
} This is good for you? |
It's good but can be taken a small step further with the props as the return and the |
Ok. I did change. What I have to put for default in Readme for these new props? |
Basically, |
This feature should support version 2.x as well |
Turns possible to user set an image for an alert type. Example: custom images for error and success alerts.
Can be new props or an options param for alertWithType method.
The text was updated successfully, but these errors were encountered: