import React from 'react' import Gallery from './gallery' import {formatPrice} from '../lib/helpers' export default class ListingDetails extends React.Component { onReadMore (e) { e.preventDefault() this.props.dispatch({type: 'EXPAND_DESCRIPTION'}) } onBackClick () { this.props.dispatch({ type: 'UPDATE_ROUTE', action: { toDispatch: { type: 'BACK_TO_RESULTS' }, params: { listingId: null } } }) this.props.dispatch({type: 'BACK_TO_RESULTS'}) } render () { const {listing, descriptionExpanded} = this.props if (!listing) { return null } const descriptionClasses = descriptionExpanded ? 'ld-description expanded' : 'ld-description' const images = listing.images.map(image => ({ original: image, thumbnail: image })) return (