|
@@ -4,34 +4,30 @@ import thunk from 'redux-thunk';
|
|
import {actionPromise} from "./index"
|
|
import {actionPromise} from "./index"
|
|
import {gql, actionGoods, getGoods, actionSearch} from "../reducers/index";
|
|
import {gql, actionGoods, getGoods, actionSearch} from "../reducers/index";
|
|
import { useEffect } from 'react';
|
|
import { useEffect } from 'react';
|
|
-import {OneGood, CGoodsList} from "./index";
|
|
|
|
|
|
+import {OneGood, GoodsList} from "./index";
|
|
import CGoodsListSearch from './goodsListSearch';
|
|
import CGoodsListSearch from './goodsListSearch';
|
|
|
|
|
|
const mapStateToProps = state => ({
|
|
const mapStateToProps = state => ({
|
|
state: state,
|
|
state: state,
|
|
- search: getGoods(state)
|
|
|
|
|
|
+ search: getGoods(state, "search")
|
|
});
|
|
});
|
|
|
|
|
|
const mapDispatchToProps = dispatch => bindActionCreators({
|
|
const mapDispatchToProps = dispatch => bindActionCreators({
|
|
getData: actionSearch
|
|
getData: actionSearch
|
|
}, dispatch);
|
|
}, dispatch);
|
|
|
|
|
|
- const GoodsSearch = ({name, getData}) => {
|
|
|
|
- console.log(name)
|
|
|
|
|
|
+ const GoodsSearch = ({search, name, getData}) => {
|
|
|
|
+ console.log(search)
|
|
useEffect(() => getData(name), [name])
|
|
useEffect(() => getData(name), [name])
|
|
return(
|
|
return(
|
|
<>
|
|
<>
|
|
<div className = "goodsWrapper">
|
|
<div className = "goodsWrapper">
|
|
- <CGoodsListSearch />
|
|
|
|
|
|
+ <GoodsList arr = {search}/>
|
|
</div>
|
|
</div>
|
|
</>
|
|
</>
|
|
)
|
|
)
|
|
}
|
|
}
|
|
const CGoodsSearch = connect(mapStateToProps, mapDispatchToProps)(GoodsSearch);
|
|
const CGoodsSearch = connect(mapStateToProps, mapDispatchToProps)(GoodsSearch);
|
|
|
|
|
|
-// const CGoodsSearch = ({}) => {
|
|
|
|
-// return(
|
|
|
|
-// <h2>Hello</h2>
|
|
|
|
-// )
|
|
|
|
-// }
|
|
|
|
|
|
+
|
|
export default CGoodsSearch;
|
|
export default CGoodsSearch;
|