feat: Implement a vocabulary view
This commit is contained in:
@@ -58,6 +58,11 @@ interface IState {
|
||||
showHelp: boolean;
|
||||
};
|
||||
|
||||
vocab: {
|
||||
loading: boolean;
|
||||
vocab: IVocab[];
|
||||
};
|
||||
|
||||
register: {
|
||||
loading: boolean;
|
||||
snackMsg: string;
|
||||
@@ -126,6 +131,11 @@ const initialState: IState = {
|
||||
showHelp: false,
|
||||
},
|
||||
|
||||
vocab: {
|
||||
loading: true,
|
||||
vocab: [],
|
||||
},
|
||||
|
||||
register: {
|
||||
loading: false,
|
||||
snackOpen: false,
|
||||
@@ -313,6 +323,18 @@ export function LateinicusApp(state: IState = initialState, action: any) {
|
||||
leaveDialog: action.state,
|
||||
}),
|
||||
});
|
||||
case Actions.VOCAB_SET_LOADING:
|
||||
return Object.assign({}, state, {
|
||||
vocab: Object.assign({}, state.vocab, {
|
||||
loading: action.state,
|
||||
}),
|
||||
});
|
||||
case Actions.VOCAB_SET_VOCAB:
|
||||
return Object.assign({}, state, {
|
||||
vocab: Object.assign({}, state.vocab, {
|
||||
vocab: action.vocab,
|
||||
}),
|
||||
});
|
||||
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