import { DecisionPhase } from 'app/Constants' ; import { AppStateWithHistory } from 'app/reducers/StateTypes' ; import { connect } from 'react-redux' ; import Redux from 'redux' ; import { LeveledSkillCheck } from '../decision/Types' ; import { ParserNode } from '../TemplateTypes' ; import { handleDecisionSelect , skillTimeMillis , toDecisionCard } from './Actions' ; import DecisionTimer , { DispatchProps , StateProps } from './DecisionTimer' ; import { mapStateToProps as mapStateToPropsBase } from './Types' ; const mapStateToProps = ( state , ownProps ) : StateProps => { return { ... mapStateToPropsBase ( state , ownProps ) , roundTimeTotalMillis : skillTimeMillis ( state . settings , state . multiplayer ) , } ; } ; const mapDispatchToProps = ( dispatch ) : DispatchProps => { return { onSelect : ( node , selected , elapsedMillis ) => { dispatch ( handleDecisionSelect ( { node , elapsedMillis , selected } ) ) ; dispatch ( toDecisionCard ( { name : 'QUEST_CARD' , phase : DecisionPhase . resolve , noHistory : true } ) ) ; } , } ; } ; const DecisionTimerContainer = connect ( mapStateToProps , mapDispatchToProps ) ( DecisionTimer ) ; export default DecisionTimerContainer ;