displaying the status of the tutorial

This commit is contained in:
Delucse
2020-09-07 15:57:09 +02:00
parent b42e466304
commit 4c66ab9173
9 changed files with 229 additions and 54 deletions
+3 -1
View File
@@ -1,6 +1,8 @@
import { combineReducers } from 'redux';
import workspaceReducer from './workspaceReducer';
import tutorialReducer from './tutorialReducer';
export default combineReducers({
workspace: workspaceReducer
workspace: workspaceReducer,
tutorial: tutorialReducer
});
+25
View File
@@ -0,0 +1,25 @@
import { TUTORIAL_SUCCESS, TUTORIAL_ERROR, TUTORIAL_CHANGE } from '../actions/types';
const initialState = {
status: JSON.parse(window.localStorage.getItem('tutorial')),
change: 0
};
export default function(state = initialState, action){
switch(action.type){
case TUTORIAL_SUCCESS:
case TUTORIAL_ERROR:
return {
...state,
status: action.payload
};
case TUTORIAL_CHANGE:
return {
...state,
change: state.change += 1
}
default:
return state;
}
}