fix: Implement more APIs

This commit is contained in:
Alexander Polynomdivision
2018-09-24 13:36:42 +02:00
parent 11bbdc627f
commit 8b6bfb681b
9 changed files with 117 additions and 46 deletions

View File

@@ -1,8 +1,13 @@
import { connect } from "react-redux";
import { setNextLevel, setDashboardNLLoading, setTopTen, setDashboardTTLoading } from "../actions";
import {
setNextLevel, setDashboardNLLoading, setTopTen, setDashboardTTLoading,
setDashboardLRLoading, setLastReview,
} from "../actions";
import { ILevel } from "../models/level";
import { ILearner } from "../models/learner";
import { IReviewMetadata } from "../models/review";
import DashboardPage from "../pages/dashboard";
@@ -12,6 +17,8 @@ const mapStateToProps = state => {
loadingNextLevel: state.dashboard.loadingNL,
loadingTopTen: state.dashboard.loadingTT,
topTen: state.topTen,
loadingLastReview: state.dashboard.loadingLR,
lastReview: state.lastReview,
};
};
const mapDispatchToProps = dispatch => {
@@ -20,6 +27,8 @@ const mapDispatchToProps = dispatch => {
setNextLevel: (level: ILevel) => dispatch(setNextLevel(level)),
setTopTen: (topTen: ILearner[]) => dispatch(setTopTen(topTen)),
setLoadingTT: (state: boolean) => dispatch(setDashboardTTLoading(state)),
setLastReview: (review: IReviewMetadata) => dispatch(setLastReview(review)),
setLoadingLR: (state: boolean) => dispatch(setDashboardLRLoading(state)),
}
};