import React, { PropTypes } from 'react'
import { connect } from 'react-redux'
import { bindActionCreators } from 'redux'
import FontAwesome from 'react-fontawesome'
import * as actions from '../services/ui/actions'
class Notifications extends React.Component{
constructor(props) {
super(props)
}
render(){
if( !this.props.notifications ) return null
return (
{
this.props.notifications.map( notification => {
return (
this.props.actions.removeNotification(notification.id) } />
{ notification.content }
)
})
}
)
}
}
const mapStateToProps = (state, ownProps) => {
return {
notifications: state.ui.notifications
}
}
const mapDispatchToProps = (dispatch) => {
return {
actions: bindActionCreators(actions, dispatch)
}
}
export default connect(mapStateToProps, mapDispatchToProps)(Notifications)