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

Allow passing in custom controls via the message props? #28

Closed phillbaker closed 6 years ago

phillbaker commented 6 years ago

Thanks for your work on maintaining this project!

What do you think about allowing custom controls in the message alert prop? So for example, to pass in buttons similar to the native push notification:

image

Example usage:

MessageBarManager.showAlert({
  title: 'Your alert title goes here',
  message: 'Your alert message goes here',
  alertType: 'success',
  children: <View style={{...}}><Button onPress={this.foo}>Not now</Button><Button onPress={this.foo}>Done</Button></View>,
});

I think this (very old) pr https://github.com/KBLNY/react-native-message-bar/pull/20 would allow this? It would probably need documentation updates and a rebase.

phillbaker commented 6 years ago

Bump @Talor-A would you accept a PR to do the above?