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 { ParserNode } from '../TemplateTypes' ; import { handleResolvePhase , } from './Actions' ; import Surge , { DispatchProps } from './Surge' ; 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 . timer } ) ) ; } , onSurgeNext : ( node ) => { dispatch ( handleResolvePhase ( { node } ) ) ; } , } ; } ; export default connect ( mapStateToProps , mapDispatchToProps ) ( Surge ) ;