Talor-A / react-native-message-bar

A notification bar alert displayed at the top of the screen for react-native
MIT License
55 stars 27 forks source link

Enable setting default per-component values. #12

Closed strokovnjaka closed 7 years ago

strokovnjaka commented 7 years ago

If style or other params are different to default values and valid for same component, they can be set for all showAlert calls, e.g.

<MessageBar
  ref="alert"
  duration={6000}
  viewTopOffset={10}
  stylesheetSuccess={{
    backgroundColor: '#52d80f',
    strokeColor: '#43c90e',
    titleColor: '#ffffff',
    messageColor: '#ffffff'
  }}
Talor-A commented 7 years ago

Hi, just got a chance to look at this. I think it's a good feature, if you could make a note of how to use it in the readme I'll go ahead and merge it, but I think it should be documented.

strokovnjaka commented 7 years ago

You are absolutely right; I have added a section in readme.

Talor-A commented 7 years ago

thanks a lot. I'll publish this to npm when I get a chance.