Skip to content

Commit

Permalink
chore(merge): merge development
Browse files Browse the repository at this point in the history
  • Loading branch information
schnogz committed Nov 2, 2021
2 parents 1c4d0c3 + b74c19f commit 7840f46
Show file tree
Hide file tree
Showing 35 changed files with 203 additions and 329 deletions.
5 changes: 3 additions & 2 deletions config/mocks/wallet-options-v4.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"cEURRewards": true,
"eddInterestFileUpload": true,
"developerMobilePairing": true,
"pollForMagicLinkData": false,
"withdrawalLocksFundsOnHold": true,
"pollForMagicLinkData": true,
"recurringBuys": true,
"signupCountry": true
}
Expand All @@ -40,6 +41,6 @@
"veriff": "https://magic.veriff.me",
"walletHelper": "https://wallet-helper.blockchain.com",
"webSocket": "wss://ws.blockchain.info",
"yapilyCallbackUrl": "https://staging.blockchain.com/brokerage-link-success"
"yapilyCallbackUrl": "https://blockchain.com/brokerage-link-success"
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "blockchain-wallet-v4",
"version": "4.59.0",
"version": "4.59.1",
"license": "AGPL-3.0-or-later",
"private": true,
"author": {
Expand Down
2 changes: 1 addition & 1 deletion packages/blockchain-wallet-v4-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"bignumber.js": "8.0.2",
"bip21": "2.0.3",
"bip39": "2.5.0",
"bitcoinforksjs-lib": "git://github.com/blockchain/bitcoinjs-lib.git#opt-in-bitcoincash-sighash",
"bitcoinforksjs-lib": "https://github.com/blockchain/bitcoinjs-lib.git#opt-in-bitcoincash-sighash",
"bitcoinjs-lib": "5.2.0",
"blockchain-info-components": "0.0.37",
"blockchain-wallet-v4": "1.0.1",
Expand Down
45 changes: 13 additions & 32 deletions packages/blockchain-wallet-v4-frontend/src/assets/locales/en.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,7 @@ type MessagesType = {
'copy.from': 'From'
'copy.from:': 'From: '
'copy.home': 'Home'
'copy.held_until': 'Held until'
'copy.here': 'here'
'copy.holdings': 'Holdings'
'copy.in_review': 'In Review'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,10 @@ const AmountTextBoxShaker = styled(AmountTextBox)<{ meta: { error: string } }>`
type LimitSectionProps = {
fee?: string
fiatCurrency: Props['fiatCurrency']
handleLearnMoreClick?: () => void
limitAmount: string
orderType: Props['orderType']
}
const LimitSection = ({
fee = '0',
fiatCurrency,
handleLearnMoreClick,
limitAmount,
orderType
}: LimitSectionProps) => {
const LimitSection = ({ fee = '0', fiatCurrency, limitAmount, orderType }: LimitSectionProps) => {
switch (orderType) {
case BrokerageOrderType.WITHDRAW:
const withdrawSubTitle = (
Expand Down Expand Up @@ -157,7 +150,12 @@ const LimitSection = ({
defaultMessage='Newly added funds are subject to a holding period. You can transfer between your Trading, Rewards, and Exchange accounts in the meantime.'
/>
</Text>
<Link size='14px' weight={500} onClick={handleLearnMoreClick}>
<Link
weight={500}
size='14px'
target='_blank'
href='https://support.blockchain.com/hc/en-us/articles/360051018131-Trading-Account-Withdrawal-Holds'
>
<FormattedMessage id='buttons.learn_more' defaultMessage='Learn More' />
</Link>
</TextGroup>
Expand Down Expand Up @@ -346,7 +344,6 @@ const EnterAmount = ({
fee,
fiatCurrency,
handleBack,
handleLearnMoreClick,
handleMethodClick,
handleSubmit,
invalid,
Expand All @@ -369,7 +366,11 @@ const EnterAmount = ({
return (
<CustomForm onSubmit={handleSubmit}>
<FlyoutContainer>
<FlyoutHeader data-e2e='depositBackToDepositMethods' mode='back' onClick={handleBack}>
<FlyoutHeader
data-e2e='depositBackToDepositMethods'
mode={orderType === BrokerageOrderType.DEPOSIT ? 'back' : 'close'}
onClick={handleBack}
>
<DepositOrWithdrawal fiatCurrency={fiatCurrency} orderType={orderType} />
</FlyoutHeader>
<FlyoutContent mode='top'>
Expand All @@ -378,7 +379,6 @@ const EnterAmount = ({
<LimitSection
fee={fee}
fiatCurrency={fiatCurrency}
handleLearnMoreClick={handleLearnMoreClick}
orderType={orderType}
limitAmount={withdrawableBalance || paymentMethod.limits.max}
/>
Expand Down Expand Up @@ -415,7 +415,6 @@ export type OwnProps =
fee?: never
fiatCurrency: FiatType
handleBack: () => void
handleLearnMoreClick?: never
handleMethodClick: () => void
minWithdrawAmount?: never
orderType: BrokerageOrderType.DEPOSIT
Expand All @@ -427,7 +426,6 @@ export type OwnProps =
fee: string
fiatCurrency: FiatType
handleBack: () => void
handleLearnMoreClick: () => void
handleMethodClick: () => void
minWithdrawAmount: string
orderType: BrokerageOrderType.WITHDRAW
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import moment from 'moment'

import { fiatToString } from '@core/exchange/utils'
import { FiatType, WithdrawalLock } from '@core/types'
import { Button, Text } from 'blockchain-info-components'
import { Button, Link, Text, TextGroup } from 'blockchain-info-components'
import { FlyoutContainer, FlyoutContent, FlyoutFooter, FlyoutHeader } from 'components/Flyout'
import { CheckoutRow } from 'components/Rows'
import { convertBaseToStandard } from 'data/components/exchange/services'
Expand All @@ -17,12 +17,22 @@ const OnHold = ({ fiatCurrency, handleHeaderClick, locks, totalLockedAmount }: P
</FlyoutHeader>
<FlyoutContent mode='top'>
<div style={{ padding: '0 40px 32px' }}>
<Text weight={400} lineHeight='24px' size='16px' color='grey600'>
<FormattedMessage
id='modals.brokerage.withdraw_holding_period'
defaultMessage='Newly added funds are subject to a holding period. You can transfer between your Trading, Rewards, and Exchange accounts in the meantime.'
/>
</Text>
<TextGroup inline>
<Text weight={400} lineHeight='24px' size='14px' color='grey600'>
<FormattedMessage
id='modals.brokerage.withdraw_holding_period'
defaultMessage='Newly added funds are subject to a holding period. You can transfer between your Trading, Rewards, and Exchange accounts in the meantime.'
/>
</Text>
<Link
weight={400}
size='14px'
target='_blank'
href='https://support.blockchain.com/hc/en-us/articles/360051018131-Trading-Account-Withdrawal-Holds'
>
<FormattedMessage id='buttons.learn_more' defaultMessage='Learn More' />
</Link>
</TextGroup>
</div>
<div>
<CheckoutRow
Expand All @@ -44,7 +54,7 @@ const OnHold = ({ fiatCurrency, handleHeaderClick, locks, totalLockedAmount }: P
color='grey400'
style={{ letterSpacing: '1px' }}
>
Clear Date
<FormattedMessage id='copy.held_until' defaultMessage='Held until' />
</Text>
<Text
uppercase
Expand All @@ -53,7 +63,7 @@ const OnHold = ({ fiatCurrency, handleHeaderClick, locks, totalLockedAmount }: P
color='grey400'
style={{ letterSpacing: '1px' }}
>
Amount
<FormattedMessage id='copy.amount' defaultMessage='Amount' />
</Text>
</div>
)}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class LockTimeContainer extends React.PureComponent<Props> {
Failure: () => null,
Loading: () => null,
NotAsked: () => null,
Success: (val) => <LockTime {...val} />
Success: (val) => (val.onHold ? <LockTime {...val} /> : null)
})
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ import { selectors } from 'data'

const getData = (state) => {
const withdrawalLocksR = selectors.components.withdraw.getWithdrawalLocks(state)
const onHold = selectors.core.walletOptions.getWithdrawalLocksFundsOnHold(state).getOrElse(false)

return lift((withdrawalLocks: ExtractSuccess<typeof withdrawalLocksR>) => ({
onHold,
withdrawalLocks
}))(withdrawalLocksR)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import React, { memo } from 'react'
import BigNumber from 'bignumber.js'
import styled from 'styled-components'

import { ADDRESS_TYPES } from '@core/redux/payment/btc/utils'
import { CoinType, CustodialFromType } from '@core/types'
import { CustodialFromType } from '@core/types'
import { Banner } from 'blockchain-info-components'
import { FormGroup, FormLabel } from 'components/Form'
import { media } from 'services/styles'

import ExchangePromo from './ExchangePromo'
import LockTime from './LockTime'

export const Row = styled.div`
Expand Down Expand Up @@ -82,32 +80,7 @@ export const CustomFeeAlertBanner = styled(Banner)`
margin-bottom: 18px;
`

export const CustodyToAccountMessage = memo(
({
account
}: {
account: CustodialFromType
// eslint-disable-next-line
amount?: {
coin: string
coinCode: CoinType
fiat: string
}
}) => {
if (account.type !== ADDRESS_TYPES.CUSTODIAL) return null
const isAvailableNone = new BigNumber(account.available).isLessThanOrEqualTo('0')
const isWithdrawableNone = new BigNumber(account.withdrawable).isLessThanOrEqualTo('0')
const isAvailableEqualToWithdrawable = new BigNumber(account.available).isEqualTo(
account.withdrawable
)

switch (true) {
// all funds are 'locked'
case isWithdrawableNone && !isAvailableNone:
case !isWithdrawableNone && !isAvailableEqualToWithdrawable:
return <LockTime />
default:
return <ExchangePromo />
}
}
)
export const CustodyToAccountMessage = memo(({ account }: { account: CustodialFromType }) => {
if (account.type !== ADDRESS_TYPES.CUSTODIAL) return null
return <LockTime />
})

0 comments on commit 7840f46

Please sign in to comment.