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