File size: 811 Bytes
f5071ca |
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 |
import { connect } from 'react-redux';
import { openModal, closeModal } from '../../actions/modal_actions';
import { createBooking } from '../../actions/booking_actions';
import BookingForm from './booking_form';
import { withRouter } from 'react-router-dom';
const msp = (state,ownProps) => {
return ({
bookings: state.entities.bookings,
spot: state.entities.spots[ownProps.match.params.spotId],
// spotId: ownProps.location.pathname
//require login goes here
formType: 'booking',
})
};
const mdp = dispatch => {
return ({
processForm: (booking) => dispatch(createBooking(booking))
})
// closeModal: () => dispatch(closeModal()),
// openModal: () => dispatch(openModal())
};
export default withRouter(connect(msp, mdp)(BookingForm)); |