Render listing location if it exists

This commit is contained in:
Kimmo Puputti 2017-03-16 16:49:07 +02:00
parent ef5fca7f56
commit c5a983d309
3 changed files with 12 additions and 1 deletions

View file

@ -30,7 +30,8 @@
height: 100%;
}
.description {
.description,
.address {
margin: 2rem;
}

View file

@ -56,6 +56,8 @@ export class ListingPageComponent extends Component {
const title = currentListing ? currentListing.attributes.title : '';
const description = currentListing ? currentListing.attributes.description : '';
const address = currentListing ? currentListing.attributes.address : '';
const geolocation = currentListing ? currentListing.attributes.geolocation : null;
// TODO Responsive image-objects need to be thought through when final image sizes are know
const images = currentListing && currentListing.images
@ -88,6 +90,9 @@ export class ListingPageComponent extends Component {
{/* eslint-disable react/no-danger */}
<div className={css.description} dangerouslySetInnerHTML={{ __html: description }} />
{/* eslint-enable react/no-danger */}
<div className={css.address}>
{address} {geolocation ? `(${geolocation.lat}, ${geolocation.lng})` : null}
</div>
<div className={css.filterSection}>
<h1>Here will be filters (or dragons)</h1>
<h2>Studio type</h2>

View file

@ -7,6 +7,11 @@ exports[`ListingPage matches snapshot 1`] = `
"__html": "listing1 description",
}
} />
<div>
listing1 address
(40, 60)
</div>
<div>
<h1>
Here will be filters (or dragons)