/ src / common / components / DappListItem / DappListItem.container.js
DappListItem.container.js
 1  import { connect } from 'react-redux'
 2  import DappListItem from './DappListItem'
 3  import {
 4    showDownVoteAction,
 5    showUpVoteAction,
 6    fetchVoteRatingAction,
 7  } from '../../../modules/Vote/Vote.reducer'
 8  import { toggleProfileModalAction } from '../../../modules/Profile/Profile.reducer'
 9  
10  const mapDispatchToProps = dispatch => ({
11    onClickUpVote: () => dispatch(showUpVoteAction()),
12    onClickDownVote: () => dispatch(showDownVoteAction()),
13    onClickUpVote: dapp => {
14      dispatch(showUpVoteAction(dapp))
15      dispatch(fetchVoteRatingAction(dapp, true, 0))
16    },
17    onClickDownVote: dapp => {
18      dispatch(showDownVoteAction(dapp))
19      dispatch(fetchVoteRatingAction(dapp, false, 3244))
20    },
21    onToggleProfileModal: data => dispatch(toggleProfileModalAction(data)),
22  })
23  
24  export default connect(
25    null,
26    mapDispatchToProps,
27  )(DappListItem)