feat: Implement a cancel button

This commit is contained in:
Alexander Polynomdivision
2018-09-24 16:16:33 +02:00
parent 2f5e572f8e
commit 7339e1ccac
5 changed files with 88 additions and 2 deletions

View File

@@ -45,6 +45,7 @@ interface IState {
review: {
current: IReviewCard;
dialogOpen: boolean;
loading: boolean;
vocab: IVocab[];
metadata: IReviewMetadata;
@@ -104,6 +105,7 @@ const initialState: IState = {
review: {
current: {} as IReviewCard,
dialogOpen: false,
loading: true,
vocab: [],
metadata: {} as IReviewMetadata,
@@ -251,6 +253,12 @@ export function LateinicusApp(state: IState = initialState, action: any) {
loadingLR: action.state,
}),
});
case Actions.REVIEW_SET_DIALOG:
return Object.assign({}, state, {
review: Object.assign({}, state.review, {
dialogOpen: action.state,
}),
});
default:
// Ignore the initialization call to the reducer. By that we can
// catch all actions that are not implemented