Sorting & showing date

This commit is contained in:
Edin Dazdarevic
2017-04-08 02:11:54 +02:00
parent ffdf1d36b3
commit 027323919e
8 changed files with 1559 additions and 67 deletions

View File

@@ -246,6 +246,15 @@ const mapIdle = ({type, action}, component) => {
})
}
const sortChange = ({type, action}, component) => {
component.setState({
sort: action.sort,
page: 0
}, () => {
component.refreshListings();
});
}
const handlers = {
SET_MIN_PRICE: setMinPrice,
SET_MAX_PRICE: setMaxPrice,
@@ -265,7 +274,8 @@ const handlers = {
BACK_TO_RESULTS: backToResults,
LOAD_MORE_LISTINGS: loadMoreListings,
MAP_IDLE: mapIdle,
PINS_LOADED: pinsLoaded
PINS_LOADED: pinsLoaded,
SORT_CHANGE: sortChange
};
export const handleMessage = ({ type, action }, component) => {