import { CombatPhase } from 'app/Constants' ; import { AppStateWithHistory } from 'app/reducers/StateTypes' ; import { connect } from 'react-redux' ; import Redux from 'redux' ; import { ParserNode } from '../TemplateTypes' ; import { tierSumDelta , toCombatPhase , } from './Actions' ; import DrawEnemies , { DispatchProps , StateProps } from './DrawEnemies' ; import { mapStateToProps as mapStateToPropsBase } from './Types' ; const mapStateToProps = ( state , ownProps ) : StateProps => { return { ... mapStateToPropsBase ( state , ownProps ) , combat : ownProps . node . ctx . templates . combat , tier : state . quest . node . ctx . templates . combat . tier , } ; } ; const mapDispatchToProps = ( dispatch ) : DispatchProps => { return { onNext : ( node , phase ) => { dispatch ( toCombatPhase ( { node , phase } ) ) ; } , onTierSumDelta : ( node , current , delta ) => { dispatch ( tierSumDelta ( { node , current , delta } ) ) ; } , } ; } ; export default connect ( mapStateToProps , mapDispatchToProps ) ( DrawEnemies ) ;