Skip to content

Commit

Permalink
Merge branch 'release/v4.61' of github.com:blockchain/blockchain-wall…
Browse files Browse the repository at this point in the history
…et-v4-frontend into release/v4.61
  • Loading branch information
schnogz committed Nov 30, 2021
2 parents 130317c + e4c6f6b commit f90c54c
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ const debounceValidate = (limits, crossBorderLimits, orderType, fiatCurrency, ba
dispatch(stopAsyncValidation('brokerageTx', limitError))
}

const error = minMaxAmount(limits, orderType, fiatCurrency, newValue)
const error = minMaxAmount(limits, orderType, fiatCurrency, newValue, bankText)
if (error) {
dispatch(stopAsyncValidation('brokerageTx', error))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ export const minMaxAmount = (
limits: { max: string; min: string },
orderType: BrokerageOrderType,
fiatCurrency: FiatType,
amount: string
amount: string,
bankText: string
) => {
const max = convertBaseToStandard('FIAT', limits.max)
const min = convertBaseToStandard('FIAT', limits.min)
Expand All @@ -26,8 +27,13 @@ export const minMaxAmount = (
value: min
})

const formattedAmount = fiatToString({
unit: fiatCurrency,
value: amount
})

// This handles the default case where we show "0" in the input field but
// it's just a placeholder and amount actuall equals '' in redux
// it's just a placeholder and amount actual equals '' in redux
if (amount === '') return undefined
// The min max logic
if (Number(amount) > Number(max)) {
Expand Down Expand Up @@ -70,6 +76,25 @@ export const minMaxAmount = (
/>
</Text>
)}

{orderType === BrokerageOrderType.DEPOSIT && (
<Text
size='14px'
color='textBlack'
weight={500}
style={{ marginTop: '24px', textAlign: 'center' }}
>
<FormattedMessage
id='modals.brokerage.deposit_limit'
defaultMessage='Looks like your {bank} only allows deposits up to {maxAmount} at at time. To deposit {enterAmount}, split your deposit into multiple transactions.'
values={{
bank: bankText,
enterAmount: formattedAmount,
maxAmount: formattedMax
}}
/>
</Text>
)}
</>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -434,24 +434,6 @@ const OverYourLimitMessage = ({ amount, currency, limit, period }) => (
const StyledOvalButton = styled(Button)`
border-radius: 32px;
`
const OverLimitButton = ({ coin }) => (
<StyledOvalButton
data-e2e='overLimitButton'
height='48px'
size='16px'
nature='dark-grey'
fullwidth
>
<Image width='16px' height='16px' name='alert-orange' />
<Text weight={600} size='16px' style={{ marginLeft: '2px' }} color='white'>
<FormattedMessage
id='copy.not_enough_coin'
defaultMessage='Not Enough {coin}'
values={{ coin }}
/>
</Text>
</StyledOvalButton>
)

const AlertButton = ({ children }) => (
<StyledOvalButton
Expand Down Expand Up @@ -509,7 +491,6 @@ export {
ModalNavWithBackArrow,
ModalNavWithCloseIcon,
NavText,
OverLimitButton,
OverYourLimitMessage,
ScanWithPhone,
Section,
Expand Down

0 comments on commit f90c54c

Please sign in to comment.