23 lines
586 B
JavaScript
23 lines
586 B
JavaScript
const appModeReducer = (state = "search results", action) => {
|
|
switch (action.type) {
|
|
case "APP_INIT":
|
|
return (state = "init");
|
|
case "APP_SEARCH_RESULTS":
|
|
return (state = "search results");
|
|
case "APP_LOGIN":
|
|
return (state = "login");
|
|
case "APP_RESTAURANT":
|
|
return (state = "restaurant");
|
|
case "APP_DISH":
|
|
return (state = "dish");
|
|
case "APP_ADD_RESTAURANT":
|
|
return (state = "add restaurant");
|
|
case "APP_ADD_DISH":
|
|
return (state = "add dish");
|
|
default:
|
|
return state;
|
|
}
|
|
};
|
|
|
|
export default appModeReducer;
|