feat: Add a registration page

This commit is contained in:
Alexander Polynomdivision
2018-10-07 18:40:48 +02:00
parent 4278751837
commit 7dc4f92319
7 changed files with 247 additions and 3 deletions

View File

@@ -55,6 +55,12 @@ interface IState {
showHelp: boolean;
};
register: {
loading: boolean;
snackMsg: string;
snackOpen: boolean;
};
topTen: ILearner[];
nextLevel: ILevel;
@@ -114,6 +120,12 @@ const initialState: IState = {
showHelp: false,
},
register: {
loading: false,
snackOpen: false,
snackMsg: "",
},
nextLevel: {} as ILevel,
lastReview: {
correct: 0,
@@ -264,6 +276,19 @@ export function LateinicusApp(state: IState = initialState, action: any) {
showHelp: action.state,
}),
});
case Actions.REGISTER_SET_SNACKBAR:
return Object.assign({}, state, {
register: Object.assign({}, state.register, {
snackMsg: action.msg,
snackOpen: action.state,
}),
});
case Actions.REGISTER_SET_LOADING:
return Object.assign({}, state, {
register: Object.assign({}, state.register, {
loading: action.state,
}),
});
default:
// Ignore the initialization call to the reducer. By that we can
// catch all actions that are not implemented