Progress on contact

This commit is contained in:
Edin Dazdarevic
2017-04-11 14:23:58 +02:00
parent 4a8740fb35
commit e65a6a48e8
5 changed files with 107 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
import React from 'react'
import Gallery from './gallery'
import {formatPrice} from '../lib/helpers'
import ContactModal from './ContactModal';
export default class ListingDetails extends React.Component {
onReadMore (e) {
@@ -23,8 +24,14 @@ export default class ListingDetails extends React.Component {
this.props.dispatch({type: 'BACK_TO_RESULTS'})
}
onContactClick () {
this.props.dispatch({
type: 'OPEN_CONTACT'
});
}
render () {
const {listing, descriptionExpanded} = this.props
const {listing, descriptionExpanded, contactFormOpen} = this.props
if (!listing) {
return null
}
@@ -94,7 +101,7 @@ export default class ListingDetails extends React.Component {
</div>
</div>
<div className="ld-check-availability">
<button>Kontaktiraj</button>
<button onClick={this.onContactClick.bind(this)}>Kontaktiraj</button>
</div>
<div className={descriptionClasses}>
{listing.longDescription}
@@ -108,6 +115,8 @@ export default class ListingDetails extends React.Component {
: null}
<div className="ld-footer" />
</div>
{contactFormOpen ? <ContactModal dispatch={this.props.dispatch} /> : null}
</div>
)
}