feat: Implement the new /dashboard API
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
import { connect } from "react-redux";
|
||||
|
||||
import {
|
||||
setNextLevel, setDashboardNLLoading, setTopTen, setDashboardTTLoading,
|
||||
setDashboardLRLoading, setLastReview,
|
||||
setNextLevel, setTopTen, setLastReview, setDashboardLoading
|
||||
} from "../actions";
|
||||
|
||||
import { ILevel } from "../models/level";
|
||||
@@ -13,22 +12,18 @@ import DashboardPage from "../pages/dashboard";
|
||||
|
||||
const mapStateToProps = state => {
|
||||
return {
|
||||
loading: state.review.loading,
|
||||
nextLevel: state.nextLevel,
|
||||
loadingNextLevel: state.dashboard.loadingNL,
|
||||
loadingTopTen: state.dashboard.loadingTT,
|
||||
topTen: state.topTen,
|
||||
loadingLastReview: state.dashboard.loadingLR,
|
||||
lastReview: state.lastReview,
|
||||
};
|
||||
};
|
||||
const mapDispatchToProps = dispatch => {
|
||||
return {
|
||||
setLoadingNL: (state: boolean) => dispatch(setDashboardNLLoading(state)),
|
||||
setLoading: (state: boolean) => dispatch(setDashboardLoading(state)),
|
||||
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)),
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user