From deae4e8217577b8f2a1242b68696fb09250bedc9 Mon Sep 17 00:00:00 2001 From: plondon Date: Mon, 3 Jun 2019 08:31:13 -0400 Subject: [PATCH] fix(TxList Welcome): move xlm to normal tx list welcome state, update other currrencies style --- config/mocks/wallet-options-v4.json | 1 + .../Content/Empty/CoinWelcome/index.js | 6 - .../Content/Empty/CoinWelcome/template.js | 185 ++++++++++-------- .../Content/Empty/CoinWelcome/template.xlm.js | 147 -------------- .../__mocks__/wallet-options-v4.js | 2 + 5 files changed, 109 insertions(+), 232 deletions(-) delete mode 100644 packages/blockchain-wallet-v4-frontend/src/scenes/Transactions/Content/Empty/CoinWelcome/template.xlm.js diff --git a/config/mocks/wallet-options-v4.json b/config/mocks/wallet-options-v4.json index a55f563dcf5..eaca80e6152 100644 --- a/config/mocks/wallet-options-v4.json +++ b/config/mocks/wallet-options-v4.json @@ -181,6 +181,7 @@ "circle": "xlm-circle-filled", "circleFilled": "xlm-circle-filled" }, + "learnMoreLink": "https://support.blockchain.com/hc/en-us/articles/360019105171-What-is-Stellar-", "minConfirmations": 1, "txExplorerBaseUrl": "https://stellarchain.io/tx", "txListAppRoute": "/xlm/transactions" diff --git a/packages/blockchain-wallet-v4-frontend/src/scenes/Transactions/Content/Empty/CoinWelcome/index.js b/packages/blockchain-wallet-v4-frontend/src/scenes/Transactions/Content/Empty/CoinWelcome/index.js index 62d2d994f69..4c781698f23 100644 --- a/packages/blockchain-wallet-v4-frontend/src/scenes/Transactions/Content/Empty/CoinWelcome/index.js +++ b/packages/blockchain-wallet-v4-frontend/src/scenes/Transactions/Content/Empty/CoinWelcome/index.js @@ -11,7 +11,6 @@ import { } from './selectors' import Welcome from './template' import WelcomePax from './template.pax' -import WelcomeXlm from './template.xlm' class CoinWelcomeContainer extends React.PureComponent { render () { @@ -37,11 +36,6 @@ class CoinWelcomeContainer extends React.PureComponent { /> ) } - case 'XLM': { - return ( - - ) - } default: { return ( props.theme['brand-quaternary']}; - ${media.mobile` + ${media.tablet` flex-direction: column; width: 100%; `}; ` const Row = styled.div` - width: 50%; - padding: 25px; - ${media.mobile` - width: 100%; - box-sizing: border-box; - `}; + display: flex; + flex-direction: row; + width: 100%; + margin-top: 16px; + &:last-child { + margin-top: 32px; + } ` const Content = styled(Text)` margin: 15px 0 20px 0; line-height: 1.4; ` -const CoinRow = styled.div` - width: 50%; +const Column = styled.div` display: flex; - position: relative; + flex-direction: row; + width: 100%; align-items: center; justify-content: center; - background-color: ${props => lighten(0.4, props.theme[props.color])}; - ${media.mobile` - width: 100%; - `}; ` -const ButtonContainer = styled.div` - display: flex; - flex-direction: row; - > button:first-child { - margin-right: 15px; - } +const FooterButton = styled(Button)` + height: 56px; + width: 100%; + font-size: 16px; + font-weight: 500; ` const LearnMoreContainer = styled(Link)` width: 640px; @@ -74,6 +66,35 @@ const LearnMoreLink = styled(Link)` display: inline-flex; ` +const getContent = currentCoin => { + switch (currentCoin.coinCode) { + case 'XLM': { + return ( + + + + ) + } + default: { + return ( + + + + ) + } + } +} + const Welcome = props => { const { availability, currentCoin, handleRequest, partner } = props @@ -81,27 +102,31 @@ const Welcome = props => { - - - - - +
+ + + + {getContent(currentCoin)} +
+ + + -
- + +
+ + {partner ? ( - + ) : ( - + )} + + { } }} > - + - + + + + + {currentCoin.learnMoreLink && ( + + + + + + + + + + + + )} + - - -
- {currentCoin.learnMoreLink && ( - - - - - - - - - - - - )}
) } diff --git a/packages/blockchain-wallet-v4-frontend/src/scenes/Transactions/Content/Empty/CoinWelcome/template.xlm.js b/packages/blockchain-wallet-v4-frontend/src/scenes/Transactions/Content/Empty/CoinWelcome/template.xlm.js deleted file mode 100644 index e648d5ce22e..00000000000 --- a/packages/blockchain-wallet-v4-frontend/src/scenes/Transactions/Content/Empty/CoinWelcome/template.xlm.js +++ /dev/null @@ -1,147 +0,0 @@ -import React from 'react' -import PropTypes from 'prop-types' -import styled from 'styled-components' -import { FormattedMessage } from 'react-intl' -import { LinkContainer } from 'react-router-bootstrap' - -import media from 'services/ResponsiveService' -import { Button, Icon, Link, Text } from 'blockchain-info-components' - -const Wrapper = styled.div` - padding-top: 20px; -` -const Container = styled.div` - display: flex; - flex-direction: column; - position: relative; - margin: 0 auto 25px; - width: 640px; - ${media.tablet` - flex-direction: column; - width: 100%; - `}; -` -const Row = styled.div` - display: flex; - flex-direction: row; - width: 100%; - margin-top: 16px; - &:last-child { - margin-top: 32px; - } -` -const Column = styled.div` - display: flex; - flex-direction: row; - width: 100%; - align-items: center; - justify-content: center; -` -const FooterButton = styled(Button)` - height: 54px; - width: 100%; - font-size: 16px; - font-weight: 500; -` - -const WelcomePax = props => { - const { availability, handleRequest, currentUserTier } = props - return ( - - - - -
- - - - - - - - - -
-
- - - -
- - - {currentUserTier ? ( - - - - - - ) : ( - - - - - - )} - - - - - - - - - -
-
- ) -} - -WelcomePax.propTypes = { - availability: PropTypes.object.isRequired, - currentCoin: PropTypes.object.isRequired, - currentUserTier: PropTypes.object.isRequired -} - -export default WelcomePax diff --git a/packages/blockchain-wallet-v4/src/redux/walletOptions/__mocks__/wallet-options-v4.js b/packages/blockchain-wallet-v4/src/redux/walletOptions/__mocks__/wallet-options-v4.js index b4b58d66b1c..91a5f6da149 100644 --- a/packages/blockchain-wallet-v4/src/redux/walletOptions/__mocks__/wallet-options-v4.js +++ b/packages/blockchain-wallet-v4/src/redux/walletOptions/__mocks__/wallet-options-v4.js @@ -150,6 +150,8 @@ export default { circle: 'xlm-circle-filled', circleFilled: 'xlm-circle-filled' }, + learnMoreLink: + 'https://support.blockchain.com/hc/en-us/articles/360019105171-What-is-Stellar-', minConfirmations: 1, name: 'Stellar', txExplorerBaseUrl: 'https://stellarchain.io/tx',