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

@@ -278,6 +278,18 @@ const updateRoute = ({type, action}, component) => {
component.router.update(action)
}
const openContact = ({type, action}, component) => {
component.setState({
contactFormOpen: true
});
}
const closeContact = ({type, action}, component) => {
component.setState({
contactFormOpen: false
});
}
const handlers = {
SET_MIN_PRICE: setMinPrice,
SET_MAX_PRICE: setMaxPrice,
@@ -299,7 +311,9 @@ const handlers = {
MAP_IDLE: mapIdle,
PINS_LOADED: pinsLoaded,
SORT_CHANGE: sortChange,
UPDATE_ROUTE: updateRoute
UPDATE_ROUTE: updateRoute,
OPEN_CONTACT: openContact,
CLOSE_CONTACT: closeContact
}
export const handleMessage = ({type, action}, component) => {
@@ -307,5 +321,6 @@ export const handleMessage = ({type, action}, component) => {
throw new `Unhandled message: ${type}`()
}
console.log(type);
return handlers[type]({type, action}, component)
}