From 95fb87d17fd1fd29322e4629ad150c581edbde37 Mon Sep 17 00:00:00 2001 From: Vasek Mlejnsky Date: Fri, 17 Aug 2018 13:08:42 +0200 Subject: [PATCH] Move 'CoinName' component inside 'RowCoin' --- .../components/AccountMenu/index.js | 2 +- .../RowCoin/components/CoinName/index.js | 35 ------------------- .../components/RowCoin/index.js | 27 ++++++++++---- 3 files changed, 22 insertions(+), 42 deletions(-) delete mode 100644 src/js/views/Wallet/components/LeftNavigation/components/RowCoin/components/CoinName/index.js diff --git a/src/js/views/Wallet/components/LeftNavigation/components/AccountMenu/index.js b/src/js/views/Wallet/components/LeftNavigation/components/AccountMenu/index.js index a5993b0e..ae6cbeef 100644 --- a/src/js/views/Wallet/components/LeftNavigation/components/AccountMenu/index.js +++ b/src/js/views/Wallet/components/LeftNavigation/components/AccountMenu/index.js @@ -19,7 +19,7 @@ import Row from '../Row'; import RowCoin from '../RowCoin'; -const Wrapper = style.div``; +const Wrapper = styled.div``; const Text = styled.span` font-size: ${FONT_SIZE.SMALLER}; diff --git a/src/js/views/Wallet/components/LeftNavigation/components/RowCoin/components/CoinName/index.js b/src/js/views/Wallet/components/LeftNavigation/components/RowCoin/components/CoinName/index.js deleted file mode 100644 index 9066a06e..00000000 --- a/src/js/views/Wallet/components/LeftNavigation/components/RowCoin/components/CoinName/index.js +++ /dev/null @@ -1,35 +0,0 @@ -import PropTypes from 'prop-types'; -import React from 'react'; -import styled from 'styled-components'; -import { ICON_SIZE } from 'config/variables'; - -const CoinNameWrapper = styled.div` - display: flex; - align-items: center; - justify-content: space-between; -`; - -const Logo = styled.div` - height: ${ICON_SIZE.BASE}; - width: ${ICON_SIZE.BASE}; - margin-right: 5px; - background-repeat: no-repeat; - background-position: center; - background-size: auto ${ICON_SIZE.BASE}; - background-image: url('${props => props.coinImg}'); -`; - -const CoinName = ({ - coinImg, text, -}) => ( - - {coinImg && } -

{text}

-
-); -CoinName.propTypes = { - coinImg: PropTypes.string, - text: PropTypes.string.isRequired, -}; - -export default CoinName; diff --git a/src/js/views/Wallet/components/LeftNavigation/components/RowCoin/index.js b/src/js/views/Wallet/components/LeftNavigation/components/RowCoin/index.js index 7352d990..455c747b 100644 --- a/src/js/views/Wallet/components/LeftNavigation/components/RowCoin/index.js +++ b/src/js/views/Wallet/components/LeftNavigation/components/RowCoin/index.js @@ -2,10 +2,25 @@ import React from 'react'; import PropTypes from 'prop-types'; import styled from 'styled-components'; import Icon from 'components/Icon'; -import { FONT_SIZE } from 'config/variables'; +import { ICON_SIZE, FONT_SIZE } from 'config/variables'; import colors from 'config/colors'; import Row from '../Row'; -import CoinName from './components/CoinName'; + +const CoinNameWrapper = styled.div` + display: flex; + align-items: center; + justify-content: space-between; +`; + +const Logo = styled.div` + height: ${ICON_SIZE.BASE}; + width: ${ICON_SIZE.BASE}; + margin-right: 5px; + background-repeat: no-repeat; + background-position: center; + background-size: auto ${ICON_SIZE.BASE}; + background-image: url('${props => props.coinImg}'); +`; const RowCoinWrapper = styled.div` padding: 16px 24px; @@ -43,10 +58,10 @@ const RowCoin = ({ /> )} - + + +

{coin.name}

+
{iconRight && (