Skip to content

Commit

Permalink
fix(WireTranfer): remove the order dependency on wire ttranfer flyout
Browse files Browse the repository at this point in the history
  • Loading branch information
awiermanncasas-bc committed Jul 26, 2022
1 parent 54ce539 commit 0284f29
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,16 @@ import React, { PureComponent } from 'react'
import { connect, ConnectedProps } from 'react-redux'
import { bindActionCreators, Dispatch } from 'redux'

import { BSPairType, CoinType, ExtractSuccess, FiatType, RemoteDataType } from '@core/types'
import {
BSOrderType,
BSPairType,
CoinType,
ExtractSuccess,
FiatType,
RemoteDataType
} from '@core/types'
import DataError from 'components/DataError'
import { actions } from 'data'
import { actions, selectors } from 'data'
import { RootState } from 'data/rootReducer'

import Loading from '../template.loading'
Expand All @@ -23,13 +30,14 @@ class BankWireDetails extends PureComponent<Props> {
Failure: (e) => <DataError message={{ message: e }} />,
Loading: () => <Loading />,
NotAsked: () => <Loading />,
Success: (val) => <Success {...val} {...this.props} />
Success: (val) => <Success {...val} {...this.props} order={this.props.order} />
})
}
}

const mapStateToProps = (state: RootState): LinkStatePropsType => ({
data: getData(state)
data: getData(state),
order: selectors.components.buySell.getBSOrder(state).data
})

const mapDispatchToProps = (dispatch: Dispatch) => ({
Expand All @@ -50,6 +58,7 @@ export type SuccessStateType = ExtractSuccess<ReturnType<typeof getData>>

type LinkStatePropsType = {
data: RemoteDataType<string, SuccessStateType>
order?: BSOrderType
}
export type Props = OwnProps & ConnectedProps<typeof connector>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ import { RootState } from 'data/rootReducer'
export const getData = (state: RootState) => {
const accountR = selectors.components.buySell.getBSAccount(state)
const userDataR = selectors.modules.profile.getUserData(state)
const orderR = selectors.components.buySell.getBSOrder(state)

return lift((account, userData, order) => ({ account, order, userData }))(
accountR,
userDataR,
orderR
)
return lift((account, userData) => ({ account, userData }))(accountR, userDataR)
}

0 comments on commit 0284f29

Please sign in to comment.