You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
716 B
26 lines
716 B
import { Dispatch } from 'redux'
|
|
import { connect } from 'react-redux'
|
|
|
|
import { setNotificationAuto, removeNotification } from '../../actions/notifications'
|
|
import { getNotifications } from '../../selectors'
|
|
import { AppState } from '../../types'
|
|
|
|
import NotificationContainer from './notification-container'
|
|
|
|
const mapStateToProps = (state: AppState) => ({
|
|
notifications: getNotifications(state),
|
|
})
|
|
|
|
const mapDispatchToProps = (dispatch: Dispatch) => ({
|
|
setAuto: (id: string) => {
|
|
dispatch(setNotificationAuto(id))
|
|
},
|
|
dismiss: (id: string) => {
|
|
dispatch(removeNotification(id))
|
|
}
|
|
})
|
|
|
|
export default connect(
|
|
mapStateToProps,
|
|
mapDispatchToProps
|
|
)(NotificationContainer)
|