|
@@ -5,23 +5,19 @@ import * as actions from "../actions/staffsAction";
|
|
|
|
|
|
import { bindActionCreators } from "redux";
|
|
import { bindActionCreators } from "redux";
|
|
|
|
|
|
|
|
+import Header from '../container/Header'
|
|
import LeftMenu from '../container/LeftMenu'
|
|
import LeftMenu from '../container/LeftMenu'
|
|
import AllStaffs from "../components/AllStaffs"
|
|
import AllStaffs from "../components/AllStaffs"
|
|
-import Header from '../container/Header'
|
|
|
|
|
|
|
|
class MainPage extends Component {
|
|
class MainPage extends Component {
|
|
|
|
|
|
componentDidMount() {
|
|
componentDidMount() {
|
|
- const { getStaffsData } = this.props
|
|
|
|
- getStaffsData()
|
|
|
|
-
|
|
|
|
|
|
+ this.props.getStaffsData()
|
|
}
|
|
}
|
|
- render() {
|
|
|
|
|
|
|
|
|
|
+ render() {
|
|
const { inputStaffs, isFetching } = this.props
|
|
const { inputStaffs, isFetching } = this.props
|
|
-
|
|
|
|
return (
|
|
return (
|
|
-
|
|
|
|
<Fragment>
|
|
<Fragment>
|
|
<Header />
|
|
<Header />
|
|
<div className="contentDiv">
|
|
<div className="contentDiv">
|
|
@@ -29,15 +25,13 @@ class MainPage extends Component {
|
|
<AllStaffs inputStaffs={inputStaffs} isFetching={isFetching} />
|
|
<AllStaffs inputStaffs={inputStaffs} isFetching={isFetching} />
|
|
</div>
|
|
</div>
|
|
</Fragment>
|
|
</Fragment>
|
|
-
|
|
|
|
);
|
|
);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
const mapStateToProps = state => ({
|
|
const mapStateToProps = state => ({
|
|
inputStaffs: state.staffs.inputStaffs,
|
|
inputStaffs: state.staffs.inputStaffs,
|
|
- isFetching: state.staffs.isFetching,
|
|
|
|
- allCategory: state.addCategory.allCategory,
|
|
|
|
|
|
+ isFetching: state.staffs.isFetching
|
|
});
|
|
});
|
|
|
|
|
|
const mapDispatchToProps = dispatch => bindActionCreators({ ...actions }, dispatch);
|
|
const mapDispatchToProps = dispatch => bindActionCreators({ ...actions }, dispatch);
|