PushContainer.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import React from 'react';
  2. import { connect } from 'react-redux';
  3. import HistoryCaseContainer from '@components/HistoryCaseContainer';
  4. import { showHistory,sortHistory,activeHistory } from '@store/actions/historyTemplates'
  5. function mapStateToProps(state) {
  6. return {
  7. showHistoryCases:state.historyTemplates.showHistoryCases,
  8. activeHistory:state.historyTemplates.activeHistory,
  9. items:state.historyTemplates.items
  10. }
  11. }
  12. function mapDispatchToProps(dispatch) {
  13. return {
  14. handleTemplateDel(id) {
  15. dispatch(delItems(id))
  16. },
  17. showHistoryBox(){
  18. dispatch(showHistory(false))
  19. },
  20. handleCaseClick(e,val){
  21. e.stopPropagation();
  22. dispatch(activeHistory(val))
  23. },
  24. handleQuoteClick(e,val){
  25. e.stopPropagation();
  26. },
  27. handleSortClick(){
  28. dispatch(sortHistory())
  29. }
  30. }
  31. }
  32. const HistoryCases = connect(
  33. mapStateToProps,
  34. mapDispatchToProps
  35. )(HistoryCaseContainer);
  36. export default HistoryCases;