Skip to content

Commit

Permalink
fix(Coinify): if trading is disabled, do not show helper text above k…
Browse files Browse the repository at this point in the history
…yc notice saying 'you can buy up to'
  • Loading branch information
Philip Welber committed May 31, 2018
1 parent 8467128 commit 939e938
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class CoinifyBuyContainer extends React.Component {
}

render () {
const { data, modalActions, coinifyActions, coinifyDataActions, rateQuoteR, buyQuoteR, currency, paymentMedium, trade, formActions, ...rest } = this.props
const { data, modalActions, coinifyActions, coinifyDataActions, rateQuoteR, buyQuoteR, currency, paymentMedium, trade, formActions, canTrade, ...rest } = this.props
const { step, checkoutBusy, coinifyBusy } = rest
const { handleTrade, fetchQuote } = coinifyDataActions
const { showModal } = modalActions
Expand Down Expand Up @@ -62,6 +62,7 @@ class CoinifyBuyContainer extends React.Component {
handleKycAction={kyc => openKYC(kyc)}
changeTab={tab => change('buySellTabStatus', 'status', tab)}
coinifyNextCheckoutStep={step => coinifyNextCheckoutStep(step)}
canTrade={canTrade}
/>,
Failure: (msg) => <div>Failure: {msg.error}</div>,
Loading: () => <Loading />,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,6 @@ export const getData = (state) => ({
checkoutBusy: path(['coinify', 'checkoutBusy'], state),
paymentMedium: path(['coinify', 'medium'], state),
step: path(['coinify', 'checkoutStep'], state),
coinifyBusy: path(['coinify', 'coinifyBusy'], state)
coinifyBusy: path(['coinify', 'coinifyBusy'], state),
canTrade: selectors.core.data.coinify.canTrade(state)
})
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ const CoinifyBuy = props => {
trade,
handleKycAction,
changeTab,
coinifyNextCheckoutStep
coinifyNextCheckoutStep,
canTrade
} = props

const profile = Remote.of(props.value.profile).getOrElse({ _limits: service.mockedLimits, _level: { currency: 'EUR' } })
Expand Down Expand Up @@ -81,7 +82,7 @@ const CoinifyBuy = props => {
<RightContainer>
{
value.kycs.length
? <KYCNotification kyc={kyc} limits={limits.buy} symbol={symbol} onTrigger={(kyc) => handleKycAction(kyc)} />
? <KYCNotification kyc={kyc} limits={limits.buy} symbol={symbol} onTrigger={(kyc) => handleKycAction(kyc)} canTrade={canTrade.data} />
: null
}
</RightContainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const LimitsNotice = styled.div`
`

const KYCNotification = (props) => {
const { kyc, onTrigger, symbol, limits, type } = props
const { kyc, onTrigger, symbol, limits, type, canTrade } = props

const state = path(['state'], kyc)
const header = kycHeaderHelper(state)
Expand All @@ -35,7 +35,7 @@ const KYCNotification = (props) => {
return (
<Wrapper>
{
(state === 'pending' || state === 'reviewing')
(state === 'pending' || state === 'reviewing') && canTrade
? <LimitsNotice>
<Text size='12px' weight={300}>
{
Expand Down

0 comments on commit 939e938

Please sign in to comment.