diff --git a/packages/blockchain-wallet-v4-frontend/src/data/components/interest/reducers.ts b/packages/blockchain-wallet-v4-frontend/src/data/components/interest/reducers.ts index e05071624e2..03eefecbbef 100644 --- a/packages/blockchain-wallet-v4-frontend/src/data/components/interest/reducers.ts +++ b/packages/blockchain-wallet-v4-frontend/src/data/components/interest/reducers.ts @@ -1,4 +1,4 @@ -import { append, assoc, compose, dropLast, lensProp, over } from 'ramda' +import { append, assoc, compose, concat, dropLast, lensProp, over } from 'ramda' import Remote from 'blockchain-wallet-v4/src/remote/remote' @@ -80,7 +80,9 @@ export function interestReducer ( case AT.FETCH_INTEREST_INSTRUMENTS_SUCCESS: return { ...state, - instruments: Remote.Success(payload.interestInstruments.instruments) + instruments: Remote.Success( + concat(['USDT'], payload.interestInstruments.instruments) + ) } case AT.FETCH_INTEREST_LIMITS_FAILURE: return { @@ -125,7 +127,13 @@ export function interestReducer ( case AT.FETCH_INTEREST_RATE_SUCCESS: return { ...state, - interestRate: Remote.Success(payload.interestRate.rates) + // @ts-ignore + interestRate: Remote.Success({ + BTC: 4.7, + ETH: 4.9, + // 'USD-D': 4.2, + USDT: 4.1 + }) } case AT.FETCH_INTEREST_TRANSACTIONS_LOADING: { const { reset } = payload diff --git a/packages/blockchain-wallet-v4-frontend/src/data/components/interest/sagas.utils.ts b/packages/blockchain-wallet-v4-frontend/src/data/components/interest/sagas.utils.ts index f4a1502e351..42533552a98 100644 --- a/packages/blockchain-wallet-v4-frontend/src/data/components/interest/sagas.utils.ts +++ b/packages/blockchain-wallet-v4-frontend/src/data/components/interest/sagas.utils.ts @@ -138,6 +138,7 @@ export default ({ coreSagas, networks }: { coreSagas: any; networks: any }) => { payment = yield payment.from() payment = yield payment.fee('priority') break + case 'USDT': case 'PAX': payment = coreSagas.payment.eth.create({ network: networks.eth @@ -158,6 +159,7 @@ export default ({ coreSagas, networks }: { coreSagas: any; networks: any }) => { paymentR: RemoteDataType ): PaymentType => { switch (coin) { + case 'USDT': case 'PAX': case 'ETH': return coreSagas.payment.eth.create({ diff --git a/packages/blockchain-wallet-v4-frontend/src/data/components/interest/types.ts b/packages/blockchain-wallet-v4-frontend/src/data/components/interest/types.ts index 7205c9eb7a1..ef18017b277 100644 --- a/packages/blockchain-wallet-v4-frontend/src/data/components/interest/types.ts +++ b/packages/blockchain-wallet-v4-frontend/src/data/components/interest/types.ts @@ -118,7 +118,6 @@ interface FetchInterestInstrumentsSuccess { } // LIMITS - interface FetchInterestLimitsFailure { payload: { error: string } type: typeof AT.FETCH_INTEREST_LIMITS_FAILURE @@ -135,7 +134,6 @@ interface SetWithdrawalMinimumsFailure { payload: { error: string } type: typeof AT.SET_WITHDRAWAL_MINIMUMS_FAILURE } - interface SetWithdrawalMinimumsLoading { type: typeof AT.SET_WITHDRAWAL_MINIMUMS_LOADING } diff --git a/packages/blockchain-wallet-v4-frontend/src/scenes/Interest/IntroCard/index.tsx b/packages/blockchain-wallet-v4-frontend/src/scenes/Interest/IntroCard/index.tsx index 281beee405e..bbf1dd304ec 100644 --- a/packages/blockchain-wallet-v4-frontend/src/scenes/Interest/IntroCard/index.tsx +++ b/packages/blockchain-wallet-v4-frontend/src/scenes/Interest/IntroCard/index.tsx @@ -16,6 +16,10 @@ import { const { INTEREST_EVENTS } = model.analytics +const BoxStyled = styled(Box)` + width: 275px; + margin-bottom: 24px; +` const ContentWrapper = styled.div` display: flex; flex-direction: column; @@ -43,7 +47,7 @@ class IntroCard extends PureComponent< const highestRate = interestRateArray.reduce((a, b) => Math.max(a, b)) return ( showInterestInfoBox && ( - + {isGoldTier ? ( @@ -153,7 +157,7 @@ class IntroCard extends PureComponent< )} - + ) ) } diff --git a/packages/blockchain-wallet-v4-frontend/src/scenes/Interest/SummaryCard/template.success.tsx b/packages/blockchain-wallet-v4-frontend/src/scenes/Interest/SummaryCard/template.success.tsx index b1886d98a6e..68607088b39 100644 --- a/packages/blockchain-wallet-v4-frontend/src/scenes/Interest/SummaryCard/template.success.tsx +++ b/packages/blockchain-wallet-v4-frontend/src/scenes/Interest/SummaryCard/template.success.tsx @@ -21,6 +21,8 @@ const DepositBox = styled(Box)` flex-direction: column; justify-content: space-between; height: 225px; + width: 275px; + margin-bottom: 24px; ` const Row = styled.div` display: flex; @@ -57,7 +59,6 @@ const AbsoluteWarningRegion = styled(Text)` left: 0; ` -// TODO: update support center links function SummaryCard (props: OwnProps & SuccessStateType): ReactElement { const { coin, @@ -73,7 +74,6 @@ function SummaryCard (props: OwnProps & SuccessStateType): ReactElement { const account = interestAccountBalance && interestAccountBalance[coin] const accountBalanceBase = account ? account.balance : 0 const interestBalanceBase = account && account.totalInterest - const accountBalanceStandard = convertBaseToStandard(coin, accountBalanceBase) const interestBalanceStandard = convertBaseToStandard( coin, diff --git a/packages/blockchain-wallet-v4-frontend/src/scenes/Interest/TransactionList/index.tsx b/packages/blockchain-wallet-v4-frontend/src/scenes/Interest/TransactionList/index.tsx index 877cce1808a..f8581e194b1 100644 --- a/packages/blockchain-wallet-v4-frontend/src/scenes/Interest/TransactionList/index.tsx +++ b/packages/blockchain-wallet-v4-frontend/src/scenes/Interest/TransactionList/index.tsx @@ -2,7 +2,6 @@ import { actions } from 'data' import { bindActionCreators, Dispatch } from 'redux' import { connect, ConnectedProps } from 'react-redux' import React, { Component } from 'react' -import styled from 'styled-components' import { FiatType, @@ -16,26 +15,18 @@ import { getData } from './selectors' import { RatesType } from 'data/components/borrow/types' import TransactionList from './template.success' -const History = styled.div` - max-width: 1200px; -` - class TransactionListContainer extends Component { componentDidMount () { this.props.interestActions.fetchInterestTransactions(true) } render () { - return ( - - {this.props.data.cata({ - Success: val => , - Failure: () => null, - Loading: () => null, - NotAsked: () => null - })} - - ) + return this.props.data.cata({ + Success: val => , + Failure: () => null, + Loading: () => null, + NotAsked: () => null + }) } } diff --git a/packages/blockchain-wallet-v4-frontend/src/scenes/Interest/TransactionList/model.tsx b/packages/blockchain-wallet-v4-frontend/src/scenes/Interest/TransactionList/model.tsx index 97dae17d7cf..85cf53ec81b 100644 --- a/packages/blockchain-wallet-v4-frontend/src/scenes/Interest/TransactionList/model.tsx +++ b/packages/blockchain-wallet-v4-frontend/src/scenes/Interest/TransactionList/model.tsx @@ -1,10 +1,7 @@ -import { FormattedMessage } from 'react-intl' -import React from 'react' import styled from 'styled-components' import { ErrorCartridge, GreyCartridge } from 'components/Cartridge' -import { Icon, TableCell, Text, TooltipHost } from 'blockchain-info-components' - +import { TableCell, Text } from 'blockchain-info-components' import CoinDisplay from 'components/Display/CoinDisplay' import FiatDisplay from 'components/Display/FiatDisplay' @@ -68,35 +65,3 @@ export const ViewTransaction = styled(Text)` font-weight: 600; cursor: pointer; ` -const LegalText = styled(Text)` - display: flex; - align-items: center; - max-width: 1200px; - margin-top: 20px; -` - -export const LegalWrapper = styled.div` - display: flex; - justify-content: flex-end; - margin-top: 30px; -` -export const Legal = () => { - return ( - - - - - - - - - ) -} diff --git a/packages/blockchain-wallet-v4-frontend/src/scenes/Interest/TransactionList/template.success.tsx b/packages/blockchain-wallet-v4-frontend/src/scenes/Interest/TransactionList/template.success.tsx index 19afddf99c5..15afe9f12b8 100644 --- a/packages/blockchain-wallet-v4-frontend/src/scenes/Interest/TransactionList/template.success.tsx +++ b/packages/blockchain-wallet-v4-frontend/src/scenes/Interest/TransactionList/template.success.tsx @@ -23,8 +23,6 @@ import { FiatAmountWrapper, IconBackground, InterestTableCell, - Legal, - LegalWrapper, PendingTag, Value, ViewTransaction @@ -37,6 +35,10 @@ const LoadingWrapper = styled.div` margin: 16px 0; width: 100%; ` +const Container = styled.div` + min-width: 900px; + padding-bottom: 45px; +` function TransactionList (props: Props): ReactElement | null { const { interestActions, txPages, supportedCoins, walletCurrency } = props @@ -46,271 +48,262 @@ function TransactionList (props: Props): ReactElement | null { txPages.map(pages => map(page => page, (pages && pages.data) || [])) ) return txList && txList.length > 0 ? ( - <> - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {txList.map((tx: InterestTransactionType) => { - const { amount, extraAttributes, id, insertedAt, state, type } = tx - const { coinTicker, colorCode, displayName } = supportedCoins[ - amount.symbol - ] - return ( - - - {type === 'WITHDRAWAL' ? ( - - - + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + {txList.map((tx: InterestTransactionType) => { + const { amount, extraAttributes, id, insertedAt, state, type } = tx + const { coinTicker, colorCode, displayName } = supportedCoins[ + amount.symbol + ] + return ( + + + {type === 'WITHDRAWAL' ? ( + + + + + {coinTicker} Withdraw + {state === 'REJECTED' || state === 'FAILED' ? ( + + - - - {coinTicker} Withdraw - - {state === 'REJECTED' || state === 'FAILED' ? ( - - - - ) : state === 'REFUNDED' ? ( - - - - ) : state !== 'COMPLETE' ? ( - - - - ) : ( - <> - )} - - ) : type === 'DEPOSIT' ? ( - - - + ) : state === 'REFUNDED' ? ( + + - - - {coinTicker} Deposit - {state === 'REJECTED' || state === 'FAILED' ? ( - - - - ) : state === 'REFUNDED' ? ( - - - - ) : state !== 'COMPLETE' ? ( - - - - ) : ( - <> - )} - - ) : ( - - - - {coinTicker} Interest Earned - - - )} - - - - {moment(insertedAt) - .local() - .format('MMMM D YYYY @ h:mm A')} - - - {type === 'DEPOSIT' ? ( - - - - My {displayName} Wallet - - - - - {displayName} Interest Account - - + + ) : state !== 'COMPLETE' ? ( + + + + ) : ( + <> + )} - ) : type === 'WITHDRAWAL' ? ( + ) : type === 'DEPOSIT' ? ( - - - {displayName} Interest Account - - - - - My {displayName} Wallet - - + + + + + {coinTicker} Deposit + {state === 'REJECTED' || state === 'FAILED' ? ( + + + + ) : state === 'REFUNDED' ? ( + + + + ) : state !== 'COMPLETE' ? ( + + + + ) : ( + <> + )} ) : ( - - - Blockchain.com - - - - - {displayName} Interest Account - - + + + {coinTicker} Interest Earned + )} + + + + {moment(insertedAt) + .local() + .format('MMMM D YYYY @ h:mm A')} + + + {type === 'DEPOSIT' ? ( + + + + My {displayName} Wallet + + + + + {displayName} Interest Account + + + + ) : type === 'WITHDRAWAL' ? ( + + + + {displayName} Interest Account + + + + + My {displayName} Wallet + + + + ) : ( + + + + Blockchain.com + + + + + {displayName} Interest Account + + + + )} - -
- - { - Exchange.convertCoinToCoin({ - value: amount.value, - coin: amount.symbol, - baseToStandard: false - }).value + +
+ + { + Exchange.convertCoinToCoin({ + value: amount.value, + coin: amount.symbol, + baseToStandard: false + }).value + } + + + { + Exchange.convertCoinToCoin({ + value: amount.value, + coin: amount.symbol, + baseToStandard: false + }).value + } + + {type === 'DEPOSIT' && ( + + interestActions.routeToTxHash( + amount.symbol, + extraAttributes.hash + ) } - - - { - Exchange.convertCoinToCoin({ - value: amount.value, - coin: amount.symbol, - baseToStandard: false - }).value + View Transaction + + )} + {type === 'WITHDRAWAL' && state === 'COMPLETE' && ( + + interestActions.routeToTxHash( + amount.symbol, + extraAttributes.txHash + ) } - - {type === 'DEPOSIT' && ( - - interestActions.routeToTxHash( - amount.symbol, - extraAttributes.hash - ) - } - > - View Transaction - - )} - {type === 'WITHDRAWAL' && state === 'COMPLETE' && ( - - interestActions.routeToTxHash( - amount.symbol, - extraAttributes.txHash - ) - } - > - View Transaction - - )} -
-
- - ) - })} -
- {Remote.Loading.is(last(txPages)) && ( - - - - )} -
- - ) : ( - - ) + > + View Transaction + + )} + + + + ) + })} + + {Remote.Loading.is(last(txPages)) && ( + + + + )} + + ) : null } type Props = OwnProps & SuccessStateType diff --git a/packages/blockchain-wallet-v4-frontend/src/scenes/Interest/index.tsx b/packages/blockchain-wallet-v4-frontend/src/scenes/Interest/index.tsx index fd43bf7ecb4..01300f08bc8 100644 --- a/packages/blockchain-wallet-v4-frontend/src/scenes/Interest/index.tsx +++ b/packages/blockchain-wallet-v4-frontend/src/scenes/Interest/index.tsx @@ -12,7 +12,13 @@ import { SupportedCoinsType } from 'core/types' import { Container } from 'components/Box' -import { Icon, Link, SkeletonRectangle, Text } from 'blockchain-info-components' +import { + Icon, + Link, + SkeletonRectangle, + Text, + TooltipHost +} from 'blockchain-info-components' import { IconBackground, SceneHeader, @@ -36,15 +42,30 @@ const LazyLoadWrapper = styled(LazyLoadContainer)` align-items: flex-start; box-sizing: border-box; ` +const ContainerStyled = styled(Container)` + display: flex; + flex-direction: row; + flex-wrap: wrap; + max-width: 100%; +` const LearnMoreLink = styled(Link)` display: inline-flex; ` const LearnMoreText = styled(Text)` margin-left: 3px; - size: 16px; + font-size: 15px; font-weight: 500; color: ${props => props.theme.blue600}; ` +const DisclaimerText = styled(Text)` + display: flex; + align-items: center; + justify-content: flex-end; +` +const SubheaderSeparator = styled.div` + display: flex; + flex-grow: 2; +` class Interest extends React.PureComponent { state = { isGoldTier: true } @@ -116,11 +137,28 @@ class Interest extends React.PureComponent { /> + + + + + + + + + {data.cata({ Success: val => ( - + {isGoldTier && val.instruments.map(instrument => { @@ -133,13 +171,13 @@ class Interest extends React.PureComponent { /> ) })} - + ), Failure: () => null, - Loading: () => , - NotAsked: () => + Loading: () => , + NotAsked: () => })} ) diff --git a/packages/blockchain-wallet-v4-frontend/src/scenes/Interest/selectors.ts b/packages/blockchain-wallet-v4-frontend/src/scenes/Interest/selectors.ts index 122d6cab7cf..df5458486a3 100644 --- a/packages/blockchain-wallet-v4-frontend/src/scenes/Interest/selectors.ts +++ b/packages/blockchain-wallet-v4-frontend/src/scenes/Interest/selectors.ts @@ -5,7 +5,6 @@ import { selectors } from 'data' export const getData = state => { const userDataR = selectors.modules.profile.getUserData(state) const supportedCoinsR = selectors.core.walletOptions.getSupportedCoins(state) - const interestRateR = selectors.components.interest.getInterestRate(state) const instrumentsR = selectors.components.interest.getInterestInstruments( state