Dish cards

This commit is contained in:
2020-07-30 21:04:13 +02:00
parent ad2a945965
commit bf609fc5cd
14 changed files with 173 additions and 2 deletions

View File

@@ -5,6 +5,7 @@ import appMode from "./appMode";
import searchQuery from "./searchQuery";
import restaurant from "./restaurant";
import dishes from "./dishes";
import toggles from "./toggles";
const rootReducer = combineReducers({
autocomplete: autoCompleteReducer,
@@ -13,6 +14,7 @@ const rootReducer = combineReducers({
searchQuery: searchQuery,
restaurant: restaurant,
dishes: dishes,
toggles: toggles,
});
export default rootReducer;

16
src/reducers/toggles.js Normal file
View File

@@ -0,0 +1,16 @@
const initialState = {
showDishList: false,
};
const toggles = (state = initialState, action) => {
switch (action.type) {
case "SET_DISHLIST_VISIBLE":
return (state = { ...state, showDishList: true });
case "SET_DISHLIST_HIDDEN":
return (state = { ...state, showDishList: false });
default:
return state;
}
};
export default toggles;