Gallery and other stuff

This commit is contained in:
Edin Dazdarevic
2017-04-02 03:31:39 +02:00
parent d6c2e857d0
commit e02cce155b
10 changed files with 4611 additions and 815 deletions

View File

@@ -11,6 +11,8 @@ class Main extends React.Component {
super(props);
this.state = {
listingDetails: false,
listings: (new Map()),
imageIndex: 0,
filters: {
minPrice: 0
}
@@ -97,7 +99,7 @@ class Main extends React.Component {
marker.addListener('click', () => {
console.log('clicking...')
this.dispatch({type: 'VIEW_LISTING_DETAILS', action: {
id: index
id: prop.url
}})
});
}
@@ -141,10 +143,12 @@ class Main extends React.Component {
const children = [];
if (this.state.listingDetails) {
const listing = this.state.listings[this.state.listingId];
console.log('CURRENT LISTINGS', this.state.listings);
const listing = this.state.listings.get(this.state.listingId);
console.log(this.state);
children.push(<ListingDetails
listing={listing}
imageIndex={this.state.imageIndex}
dispatch={this.dispatch.bind(this)}
descriptionExpanded={this.state.descriptionExpanded}
onBackClick={this.onBackClick.bind(this)}/>);