aboutsummaryrefslogtreecommitdiffstats
path: root/app/javascript/vehicle_journeys/containers/tools/NotesEditVehicleJourney.js
blob: 6290ae3bfb68d229bde15ba438dd364eb22e41ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import actions from '../../actions'
import { connect } from 'react-redux'
import NotesEditComponent from '../../components/tools/NotesEditVehicleJourney'

const mapStateToProps = (state, ownProps) => {
  return {
    editMode: state.editMode,
    disabled: ownProps.disabled,
    modal: state.modal,
    vehicleJourneys: state.vehicleJourneys,
    status: state.status
  }
}

const mapDispatchToProps = (dispatch) => {
  return {
    onModalClose: () =>{
      dispatch(actions.closeModal())
    },
    onOpenNotesEditModal: (vj) =>{
      dispatch(actions.openNotesEditModal(vj))
    },
    onToggleFootnoteModal: (footnote, isShown) => {
      dispatch(actions.toggleFootnoteModal(footnote, isShown))
    },
    onNotesEditVehicleJourney: (footnotes) =>{
      dispatch(actions.editVehicleJourneyNotes(footnotes))
    }
  }
}

const NotesEditVehicleJourney = connect(mapStateToProps, mapDispatchToProps)(NotesEditComponent)

export default NotesEditVehicleJourney