EventCard.js 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. import React from 'react';
  2. //import { connect } from "react-redux";
  3. import './eventCard.scss';
  4. import Sidebar from '../../components/sidebar/Sidebar';
  5. export class EventCard extends React.Component {
  6. render() {
  7. const { event } = this.props;
  8. const dateArr = new Date(event.eventDate).toDateString().split(' ');
  9. console.log( event );
  10. return (
  11. <>
  12. <Sidebar />
  13. <div className="event-card">
  14. <div className="event-card-cap">
  15. <div className="event-card-img">
  16. <img src={event.mainBannerPicture} alt="banner" />
  17. </div>
  18. <div className="event-card-title">
  19. <div className="container-wrap">
  20. <h2>{event.title}</h2>
  21. <p className="country">{event.country}, {event.city}</p>
  22. <p className="event-type">{event.eventType}</p>
  23. <div className="date">
  24. <p>
  25. {
  26. dateArr.map(
  27. (el, ind) => ind > 0 ? <span key={ind}>{el} </span> : null
  28. )
  29. }
  30. </p>
  31. </div>
  32. <div>
  33. <button>Register</button>
  34. </div>
  35. </div>
  36. </div>
  37. </div>
  38. <div className="container-wrap">
  39. <div className="event-card-info">
  40. <p>{event.ageLimit}</p>
  41. <p>{event.aidStations}</p>
  42. <p>{event.awardMedals}</p>
  43. <p>{event.equipmentStorage}</p>
  44. <p>{event.halfmarathoneDistancePrice}</p>
  45. <p>{event.marathoneDistancePrice}</p>
  46. <p>{event.maximumTime}</p>
  47. <p>{event.overview}</p>
  48. <p>{event.parking}</p>
  49. <p>{event.refreshments}</p>
  50. {/*{event.contentVideo}
  51. {event.mainBannerPicture}
  52. {event.map}
  53. */}
  54. </div>
  55. </div>
  56. </div>
  57. </>
  58. )
  59. }
  60. }
  61. export default EventCard;
  62. /*const mapStateToProps = state => {
  63. return {
  64. events: state.getEvents.events
  65. };
  66. };
  67. export default connect(
  68. mapStateToProps,
  69. { getAllEvents }
  70. )(Events);*/