feat: Rework the Level UI
This commit is contained in:
@@ -30,6 +30,9 @@ interface IState {
|
||||
lookedAt: number[];
|
||||
vocab: IVocab[];
|
||||
loading: boolean;
|
||||
stepper: number;
|
||||
leaveDialog: boolean;
|
||||
reviewDialog: boolean;
|
||||
};
|
||||
|
||||
levelList: {
|
||||
@@ -95,6 +98,9 @@ const initialState: IState = {
|
||||
lookedAt: [0],
|
||||
vocab: [],
|
||||
loading: true,
|
||||
stepper: 0,
|
||||
leaveDialog: false,
|
||||
reviewDialog: false,
|
||||
},
|
||||
|
||||
levelList: {
|
||||
@@ -289,6 +295,24 @@ export function LateinicusApp(state: IState = initialState, action: any) {
|
||||
loading: action.state,
|
||||
}),
|
||||
});
|
||||
case Actions.LEVEL_SET_STEPPER:
|
||||
return Object.assign({}, state, {
|
||||
level: Object.assign({}, state.level, {
|
||||
stepper: action.index,
|
||||
}),
|
||||
});
|
||||
case Actions.LEVEL_SET_REVIEW_DIAG:
|
||||
return Object.assign({}, state, {
|
||||
level: Object.assign({}, state.level, {
|
||||
reviewDialog: action.state
|
||||
}),
|
||||
});
|
||||
case Actions.LEVEL_SET_LEAVE_DIAG:
|
||||
return Object.assign({}, state, {
|
||||
level: Object.assign({}, state.level, {
|
||||
leaveDialog: action.state,
|
||||
}),
|
||||
});
|
||||
default:
|
||||
// Ignore the initialization call to the reducer. By that we can
|
||||
// catch all actions that are not implemented
|
||||
|
||||
Reference in New Issue
Block a user