Guest User

Untitled

a guest
Jun 18th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. /**
  2. * Created by.
  3. */
  4. import * as React from 'react'
  5. import {Col, Row, Card, CardHeader, CardBody, CardColumns, CardText, CardFooter} from 'reactstrap'
  6. import {InfoWindow, Marker} from 'react-google-maps'
  7.  
  8. export default class home extends React.Component {
  9. state = {
  10. isOpen: false
  11. }
  12.  
  13. toggleOpen = () => {
  14. this.setState(({ isOpen }) => (
  15. {
  16. isOpen: !isOpen,
  17. }
  18. ));
  19. if(this.state.isOpen)
  20. console.log("state is open")
  21. else
  22. console.log("state is not open")
  23. }
  24.  
  25.  
  26.  
  27. render()
  28. {
  29. const { isOpen } = this.state;
  30. return (
  31. <Marker
  32. position={this.props.position}
  33. onClick={this.toggleOpen}>
  34. <InfoWindow isOpen={isOpen}>
  35. <Card className="hovercard">
  36. <Row>
  37. <CardColumns sm={6} lg={3}>a
  38. <CardHeader>
  39. {this.props.homestay}
  40. </CardHeader>
  41. <CardText className="avatar">
  42. <img alt="profile img" src={this.props.profilePic}/>
  43. </CardText>
  44. <div className="info">
  45. <CardText>{this.props.descrip}</CardText>
  46. </div>
  47. <CardFooter>
  48. {this.props.price}
  49. </CardFooter>
  50. </CardColumns>
  51. </Row>
  52. </Card>
  53. </InfoWindow>
  54. </Marker>
  55. )
  56. }
  57. }
Add Comment
Please, Sign In to add comment