|
@@ -2,38 +2,27 @@ import React, { Component } from "react";
|
|
import { bindActionCreators } from "redux";
|
|
import { bindActionCreators } from "redux";
|
|
import { connect } from "react-redux";
|
|
import { connect } from "react-redux";
|
|
|
|
|
|
-import HomePage from "../components/home-page";
|
|
|
|
-import { add, dec } from "../actions/test1";
|
|
|
|
-
|
|
|
|
-import logo from "./logo.svg";
|
|
|
|
-import "./App.css";
|
|
|
|
|
|
+import Page from "../components/page";
|
|
|
|
+import * as actions from "../actions/todo";
|
|
|
|
+import Header from "../components/header";
|
|
|
|
|
|
class App extends Component {
|
|
class App extends Component {
|
|
render() {
|
|
render() {
|
|
- const { counter, add, dec } = this.props;
|
|
|
|
- console.log("erw", this.props);
|
|
|
|
return (
|
|
return (
|
|
- <div className="App">
|
|
|
|
- <header className="App-header">
|
|
|
|
- <img src={logo} className="App-logo" alt="logo" />
|
|
|
|
- <p>
|
|
|
|
- Edit <code>src/App.js</code> and save to reload.
|
|
|
|
- </p>
|
|
|
|
- <a className="App-link" href="https://reactjs.org" target="_blank" rel="noopener noreferrer">
|
|
|
|
- Learn React {counter}
|
|
|
|
- </a>
|
|
|
|
- </header>
|
|
|
|
- <HomePage dec={dec} add={add} />
|
|
|
|
|
|
+ <div>
|
|
|
|
+ <Header />
|
|
|
|
+ <Page {...this.props} />
|
|
</div>
|
|
</div>
|
|
);
|
|
);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
const mapStateToProps = state => ({
|
|
const mapStateToProps = state => ({
|
|
- counter: state.test1.count
|
|
|
|
|
|
+ inputData: state.todo.inputData,
|
|
|
|
+ list: state.todo.list
|
|
});
|
|
});
|
|
|
|
|
|
-const mapDispatchToProps = dispatch => bindActionCreators({ add, dec }, dispatch);
|
|
|
|
|
|
+const mapDispatchToProps = dispatch => bindActionCreators({ ...actions }, dispatch);
|
|
|
|
|
|
export default connect(
|
|
export default connect(
|
|
mapStateToProps,
|
|
mapStateToProps,
|