This repository has been archived on 2022-03-12. You can view files and clone it, but cannot push or open issues or pull requests.
Lateinicus/frontend/src/containers/LevelList.ts
2018-10-02 17:52:07 +02:00

30 lines
840 B
TypeScript

import { connect } from "react-redux";
import {
setLevelListLoading, setLevels, setLevelListSnackbar
} from "../actions";
import { ILevel } from "../models/level";
import LevelListPage from "../pages/levelList";
const mapStateToProps = state => {
return {
levels: state.levels,
loading: state.levelList.loading,
user: state.user,
snackbar: state.levelList.snackbar,
};
};
const mapDispatchToProps = dispatch => {
return {
setLoading: (state: boolean) => dispatch(setLevelListLoading(state)),
setLevels: (levels: ILevel[]) => dispatch(setLevels(levels)),
setSnackbar: (state: boolean) => dispatch(setLevelListSnackbar(state)),
};
};
const LevelListContainer = connect(mapStateToProps,
mapDispatchToProps)(LevelListPage);
export default LevelListContainer;