// @flow
import RenderSuccess from './index.render'
import {connect} from 'react-redux'
import {sawPaperKey} from '../../../actions/signup'
import {navigateUp} from '../../../actions/route-tree'

// $FlowIssue
export default connect(
  state => ({
    paperkey: state.signup.paperkey,
    waiting: state.signup.waiting,
  }),
  dispatch => ({
    onFinish: () => { dispatch(sawPaperKey()) },
    onBack: () => { dispatch(navigateUp()) },
  })
)(RenderSuccess)

// @flow
import RenderSuccess from './index.render'
import {connect} from 'react-redux'
import {sawPaperKey} from '../../../actions/signup'
import {navigateUp} from '../../../actions/route-tree'

type OwnProps = any

export default connect(
  (state: any, {routeProps}: OwnProps) => ({
    paperkey: state.signup.paperkey,
    waiting: state.signup.waiting,
    ...routeProps,
  }),
  (dispatch, {routeProps}: OwnProps) => ({
    onFinish: routeProps.onFinish ? routeProps.onFinish : () => { dispatch(sawPaperKey()) },
    onBack: routeProps.onBack ? routeProps.onBack : () => { dispatch(navigateUp()) },
  })
)(RenderSuccess)

Fix prop routing for login path through success
Fix prop routing for login path through success

In both the login (KEX) flow for provisioning and the signup (rpc)
path, we end up at shared/login/signup/success.  But it needs to
use state from the store in the success path (this was working),
and route tree state received from KEX in the login path (this
wasn't hooked up at all).
