Services.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import React from 'react';
  2. import {Link} from 'react-router-dom'
  3. import {connect} from 'react-redux'
  4. export class Services extends React.Component {
  5. render() {
  6. const {data} = this.props;
  7. return (
  8. <div className="main">
  9. <div className="wrapper">
  10. <div className = "doctors-wrap">
  11. {
  12. data.map(el => (
  13. <div key={el._id} style={{display:'flex',flexDirection:'column', width:'200px', margin:'10px 20px'}}>
  14. <p>{el.name}</p>
  15. <p>Duration:{el.duration}h</p>
  16. <p>{el.description}</p>
  17. <p>Price:{el.price}грн.</p>
  18. <div>
  19. <Link to={`/services/${el._id}`}>More Info</Link>
  20. <button>Make appointment</button>
  21. </div>
  22. </div>
  23. ))
  24. }
  25. </div>
  26. </div>
  27. </div>
  28. );
  29. }
  30. }
  31. const mapStateToProps = state => {
  32. return {
  33. data:state.app.services
  34. }
  35. };
  36. const mapDispatchToProps = {
  37. };
  38. export default connect (mapStateToProps,mapDispatchToProps)(Services)