summaryrefslogtreecommitdiff
path: root/client/containers/taskStyleLink.js
blob: 6157e00ac04a186d7e3b6e849ddd65fb30f22604 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { connect } from 'react-redux'
import { setStyle } from '../actions'
import Link from '../components/UI/Link.jsx'

const mapStateToProps = (state, ownProps) => ({
  selected: state.currentTask.style == ownProps.file
})

const mapDispatchToProps = (dispatch, ownProps) => ({
  onClick: () => {
    dispatch(setStyle(ownProps.file))
  }
})

const TaskStyleLink = connect(
  mapStateToProps,
  mapDispatchToProps
)(Link)

export default TaskStyleLink