|
@@ -1,6 +1,7 @@
|
|
|
import React from 'react';
|
|
|
import { connect } from "react-redux";
|
|
|
|
|
|
+import { getRequestEvent } from "../../actions/getRequestEvent";
|
|
|
import { regEventSubmit } from "../../actions/registrationEvent";
|
|
|
|
|
|
import './eventCard.scss';
|
|
@@ -10,10 +11,14 @@ import Footer from '../../components/footer/Footer';
|
|
|
import RegFormEvent from '../../components/reg-form-event/RegFormEvent';
|
|
|
|
|
|
export class EventCard extends React.Component {
|
|
|
+ componentDidMount() {
|
|
|
+ this.props.getRequestEvent(this.props.match.params.id);
|
|
|
+ }
|
|
|
+
|
|
|
render() {
|
|
|
const { event, regEventSubmit } = this.props;
|
|
|
const dateArr = new Date(event.eventDate).toDateString().split(' ');
|
|
|
- console.log( event );
|
|
|
+ //console.log(event);
|
|
|
return (
|
|
|
<>
|
|
|
<Sidebar />
|
|
@@ -36,9 +41,6 @@ export class EventCard extends React.Component {
|
|
|
}
|
|
|
</p>
|
|
|
</div>
|
|
|
- {/*<div>
|
|
|
- <button>Register</button>
|
|
|
- </div>*/}
|
|
|
</div>
|
|
|
<div className="bg-black"></div>
|
|
|
</div>
|
|
@@ -72,8 +74,8 @@ export class EventCard extends React.Component {
|
|
|
|
|
|
{
|
|
|
event.map && <div className="map-wrap">
|
|
|
- {/* click open pop-up with map*/}
|
|
|
- <img src={event.map} alt="map" />
|
|
|
+ {/*click open pop-up with map*/}
|
|
|
+ <img src={event.map.toString()} alt="banner" />
|
|
|
</div>
|
|
|
}
|
|
|
|
|
@@ -107,15 +109,13 @@ export class EventCard extends React.Component {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-//export default EventCard;
|
|
|
-
|
|
|
-/*const mapStateToProps = state => {
|
|
|
+const mapStateToProps = state => {
|
|
|
return {
|
|
|
- events: state.getEvents.events
|
|
|
+ event: state.getEventCard.event
|
|
|
};
|
|
|
-};*/
|
|
|
+};
|
|
|
|
|
|
export default connect(
|
|
|
- null,
|
|
|
- { regEventSubmit }
|
|
|
+ mapStateToProps,
|
|
|
+ { regEventSubmit, getRequestEvent }
|
|
|
)(EventCard);
|