import { toPrevious } from 'app/actions/Card' ; import { CombatPhase } from 'app/Constants' ; import { AppStateWithHistory , CardName } from 'app/reducers/StateTypes' ; import { connect } from 'react-redux' ; import Redux from 'redux' ; import { toCombatPhase } from '../combat/Actions' ; import { ParserNode } from '../TemplateTypes' ; import { handleDecisionRoll } from './Actions' ; import ResolveDecision , { DispatchProps } from './ResolveDecision' ; import { mapStateToProps as mapStateToPropsBase , StateProps } from './Types' ; const mapStateToProps = ( state , ownProps ) : StateProps => { return mapStateToPropsBase ( state , ownProps ) ; } ; const mapDispatchToProps = ( dispatch ) : DispatchProps => { return { onReturn : ( ) => { dispatch ( toPrevious ( { before : false , matchFn : ( c , n ) => n . ctx . templates . combat . phase !== CombatPhase . midCombatDecisionTimer } ) ) ; } , onRoll : ( node , roll ) => { dispatch ( handleDecisionRoll ( { node , roll } ) ) ; } , onCombatDecisionEnd : ( node ) => { dispatch ( toCombatPhase ( { node , phase : CombatPhase . prepare } ) ) ; } , } ; } ; const ResolveDecisionContainer = connect ( mapStateToProps , mapDispatchToProps ) ( ResolveDecision ) ; export default ResolveDecisionContainer ;