Skip to content

Conversation

@VitaliiK91
Copy link
Contributor

This pull request adds ability to pass arbitrary props to NotificationBody component.
Props can be passed like:

const passProps = {
  type: 'error',
};

this.props.showNotification({
  title: 'You pressed it!',
  message: 'The notification has been triggered',
  onPress: () => Alert.alert('Alert', 'You clicked the notification!'),
  passProps,
});

@VitaliiK91
Copy link
Contributor Author

Hi @robcalcroft, any suggestions for this pull request? Any chances it can get merged? Thanks! 🙏

icon={icon}
vibrate={vibrate}
onClose={() => this.setState({ isOpen: false }, this.closeNotification)}
{...this.state.passProps}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey! Sorry about the late response. Happy for this feature to go in with a couple of few changes.

  1. First can we rename passProps to additionalProps, I think that language is clearer about what they are.
  2. Secondly can you not spread them and instead pass them like additionalProps={additionalProps}, I'd like to keep the top level props scope clean from arbitrary props.
  3. Can you add this new prop to the README and document it.

pass as additionalProps instead of spread
@VitaliiK91
Copy link
Contributor Author

@robcalcroft Thanks for reviewing, I addressed your comments. Let me know if it looks good. Best regards!

@VitaliiK91
Copy link
Contributor Author

@robcalcroft Thanks for reviewing, if everything looks good maybe it could be merged?

@robcalcroft robcalcroft merged commit 658ca4a into robcalcroft:master Mar 24, 2020
@robcalcroft
Copy link
Owner

Done 😄 sorry about the wait will release it on npm now

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.

2 participants