Dish cards
This commit is contained in:
@@ -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
16
src/reducers/toggles.js
Normal 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;
|
||||
Reference in New Issue
Block a user