pass expected arguments to notify action

pull/1205/head
Jade McGough 2017-04-07 15:12:13 -07:00
parent 295d05eaba
commit a9c5d8f146
1 changed files with 9 additions and 3 deletions

View File

@ -25,19 +25,25 @@ const App = React.createClass({
notify: func.isRequired,
},
handleAddFlashMessage({type, text}) {
const {notify} = this.props
notify(type, text)
},
render() {
const {params: {sourceID}, location, notify} = this.props
const {params: {sourceID}, location} = this.props
return (
<div className="chronograf-root">
<SideNavContainer
sourceID={sourceID}
addFlashMessage={notify}
addFlashMessage={this.handleAddFlashMessage}
currentLocation={this.props.location.pathname}
/>
<Notifications location={location} />
{this.props.children && React.cloneElement(this.props.children, {
addFlashMessage: notify,
addFlashMessage: this.handleAddFlashMessage,
})}
</div>
)