Advertisement
vandasche

Untitled

Apr 26th, 2020
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.88 KB | None | 0 0
  1. import React, { Component } from 'react';
  2. import { Container, Row, Col, Button, Modal, Form } from 'react-bootstrap';
  3. import * as moment from 'moment';
  4. import 'moment/locale/pt-br';
  5. import { connect } from 'react-redux';
  6.  
  7. class showProperty extends Component {
  8. constructor(props) {
  9. super(props);
  10. }
  11. now = moment().format('LLLL');
  12. state = {
  13. book: false,
  14. };
  15. showModal = () => {
  16. this.setState({ book: true });
  17. };
  18. closeModal = () => {
  19. this.setState({ book: false });
  20. };
  21.  
  22. componentDidMount() {
  23. const id = this.props.id;
  24. console.log(typeof id);
  25. const data = this.props.house.data;
  26. console.log(data);
  27. const property = data.filter((data) => data.id === id - 0)[0];
  28. console.log(property);
  29. property = this.state.property;
  30. }
  31.  
  32. render() {
  33. console.log(this.state.property);
  34. return (
  35. <div>
  36. <Container fluid style={{ width: '60%' }}>
  37. <Row>
  38. <Col xs={12}>
  39. <img
  40. src=''
  41. style={{ width: '1100px', height: '250px' }}
  42. alt=''
  43. ></img>
  44. </Col>
  45. </Row>
  46. <Row style={{ marginTop: '20px' }}>
  47. <Col xs={4}>
  48. <img src='' alt=''></img>
  49. </Col>
  50. <Col xs={4} style={{}}>
  51. <img src='' alt='' style={{ paddingLeft: '12px' }}></img>
  52. </Col>
  53. <Col xs={4} style={{ paddingRight: '15px' }}>
  54. <img src='' alt='' style={{ paddingLeft: '15px' }}></img>
  55. </Col>
  56. </Row>
  57. <Row style={{ marginTop: '20px' }}>
  58. <Col>
  59. <h1></h1>
  60. </Col>
  61. </Row>
  62. <Row>
  63. <Col xs={4}>
  64. <h3>name</h3>
  65. <p>kota</p>
  66. </Col>
  67. <Col xs={4}></Col>
  68. <Col>
  69. <Row xs={4}>
  70. <Col xs={4}>
  71. <h6>Bedroom</h6>
  72. </Col>
  73. <Col xs={4}>
  74. <h6>Bathroom</h6>
  75. </Col>
  76. <Col xs={4}>
  77. <h6>Area</h6>
  78. </Col>
  79. </Row>
  80. <Row xs={4}>
  81. <Col xs={4}>
  82. <h6>Bedroom</h6>
  83. </Col>
  84. <Col xs={4}>
  85. <h6>Bathroom</h6>
  86. </Col>
  87. <Col xs={4}>
  88. <h6>200ft</h6>
  89. </Col>
  90. </Row>
  91. </Col>
  92. </Row>
  93. <Row style={{ marginLeft: '5px' }}>
  94. <h5>Description</h5>
  95. </Row>
  96. <Row style={{ marginLeft: '5px' }}>lorem ipsum</Row>
  97. <Row>
  98. <Col xs={10}></Col>
  99. <Col>
  100. <Button variant='primary' onClick={this.showModal}>
  101. BOOK NOW
  102. </Button>
  103. </Col>
  104. </Row>
  105. </Container>
  106.  
  107. <Modal show={this.state.book} onHide={this.closeModal}>
  108. <Modal.Header closeButton>
  109. <Modal.Title>
  110. <h5>HOW LONG U WILL STAY</h5>
  111. </Modal.Title>
  112. </Modal.Header>
  113. <Modal.Body>
  114. <Form>
  115. <Form.Group controlId='start'>
  116. <Form.Label>Check-In</Form.Label>
  117. <Form.Control name='dateStart' type='date' />
  118. <Form.Label>Check-Out</Form.Label>
  119. <Form.Control name='dateEnd' type='date' />
  120. </Form.Group>
  121. </Form>
  122. </Modal.Body>
  123. <Modal.Footer>
  124. <Button variant='primary' onClick={this.closeModal}>
  125. ORDER
  126. </Button>
  127. </Modal.Footer>
  128. </Modal>
  129. </div>
  130. );
  131. }
  132. }
  133.  
  134. const mapStateToProps = (state) => {
  135. return {
  136. house: state.house,
  137. };
  138. };
  139.  
  140. export default connect(mapStateToProps)(showProperty);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement