2020-03-16 16:01:05 +01:00
|
|
|
import { connect } from "react-redux";
|
|
|
|
import Subjects from "../components/Subjects";
|
|
|
|
import { addSubject, removeSubject } from "../actions";
|
|
|
|
|
|
|
|
const mapStateToProps = state => {
|
|
|
|
return {
|
|
|
|
subjects: state.subjects,
|
2020-03-31 11:06:55 +02:00
|
|
|
timetable: state.timetable,
|
2020-03-16 16:01:05 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
const mapDispatchToProps = dispatch => {
|
|
|
|
return {
|
|
|
|
addSubject: subject => dispatch(addSubject(subject)),
|
|
|
|
removeSubject: id => dispatch(removeSubject(id))
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
const SubjectsContainer = connect(mapStateToProps, mapDispatchToProps)(Subjects);
|
|
|
|
|
|
|
|
export default SubjectsContainer;
|