Advertisement
vandasche

Untitled

Apr 29th, 2020
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. import React, { Component } from 'react';
  2. import { connect } from 'react-redux';
  3. import * as actConsult from '../_actions/consult';
  4. import Moment from 'react-moment';
  5.  
  6. class reservation_data extends Component {
  7. componentDidMount() {
  8. const id = this.props.item.id;
  9. const data = JSON.parse(localStorage.getItem('credentials'));
  10. this.props.dispatch(actConsult.getReply(data.token, id));
  11. }
  12.  
  13. render() {
  14. // const { data: consul, loading, error } = this.props.consul;
  15. // if (error) return <>error</>;
  16. // if (loading) return <>Loading</>;
  17.  
  18. const data = this.props.item;
  19. return (
  20. <>
  21. <div className='card p-3 mb-3'>
  22. <div className='d-flex align-items-top mb-3'>
  23. <div className='mr-3'>
  24. <img
  25. src={process.env.PUBLIC_URL + `../logos/login.png`}
  26. alt=''
  27. className='avatar'
  28. style={{ height: 60, width: 60, borderRadius: 45 }}
  29. />
  30. </div>
  31.  
  32. <div className='d-flex w-100 justify-content-between align-content-top'>
  33. <div>
  34. <h5 className='mb-0'>{data.subject}</h5>
  35. <small>
  36. <Moment format='DD,MMM YYYY'>{data.createdAt}</Moment>
  37. </small>
  38. <br />
  39. <small>{data.description}</small>
  40. </div>
  41. <div>
  42. <small className='bold'>
  43. <Moment format='DD,MMM YYYY'>{data.createdAt}</Moment>
  44. </small>
  45. </div>
  46. </div>
  47. </div>
  48. <div className='border-top'>
  49. <div className='text-center mt-3'>
  50. <h5>waiting reply</h5>
  51. </div>
  52. </div>
  53. </div>
  54. </>
  55. );
  56. }
  57. }
  58.  
  59. const mapStateToProps = (state) => {
  60. return {
  61. // consul: state.consultation,
  62. };
  63. };
  64.  
  65. export default connect(mapStateToProps)(reservation_data);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement