Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Created by.
- */
- import * as React from 'react'
- import {Col, Row, Card, CardHeader, CardBody, CardColumns, CardText, CardFooter} from 'reactstrap'
- import {InfoWindow, Marker} from 'react-google-maps'
- export default class home extends React.Component {
- state = {
- isOpen: false
- }
- toggleOpen = () => {
- this.setState(({ isOpen }) => (
- {
- isOpen: !isOpen,
- }
- ));
- if(this.state.isOpen)
- console.log("state is open")
- else
- console.log("state is not open")
- }
- render()
- {
- const { isOpen } = this.state;
- return (
- <Marker
- position={this.props.position}
- onClick={this.toggleOpen}>
- <InfoWindow isOpen={isOpen}>
- <Card className="hovercard">
- <Row>
- <CardColumns sm={6} lg={3}>a
- <CardHeader>
- {this.props.homestay}
- </CardHeader>
- <CardText className="avatar">
- <img alt="profile img" src={this.props.profilePic}/>
- </CardText>
- <div className="info">
- <CardText>{this.props.descrip}</CardText>
- </div>
- <CardFooter>
- {this.props.price}
- </CardFooter>
- </CardColumns>
- </Row>
- </Card>
- </InfoWindow>
- </Marker>
- )
- }
- }
Add Comment
Please, Sign In to add comment