-
Notifications
You must be signed in to change notification settings - Fork 0
/
CampsiteInfoComponent.js
45 lines (38 loc) · 1.28 KB
/
CampsiteInfoComponent.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import React, { Component } from 'react';
import { Card, CardImg, CardImgOverlay, CardText, CardBody, CardTitle } from 'reactstrap';
class CampsiteInfo extends Component {
renderCampsite(Campsite) {
return (<div className="col-md-5 m-1">
<Card>
<CardImg top src={Campsite.image} alt={Campsite.name} />
<CardBody>
<CardTitle>{Campsite.name}</CardTitle>
<CardText>{Campsite.description}</CardText>
</CardBody>
</Card>
</div>
)
}
render() {
if (this.props.Campsite != null) {
return <div className="row">
{this.renderCampsite(this.props.Campsite)}
</div>
} else {
return <div />
}
}
}
// renderComments(comments) {
// if(this.props.comments){
// return ( <div className=”col-md-5 m-1” /> )
// <h4>Comments</h4>
// {this.map(comments)}
// {text}
// {author, date}
// {new Intl.DateTimeFormat('en-US', { year: 'numeric', month: 'short', day: '2-digit'}).format(new Date(Date.parse(comment.date)))}
// </div>
// }
// }
// Return (<div />)
export default CampsiteInfo;