1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-12-28 18:08:08 +00:00

Rename components & flatten folder structure

- 'CoinLogo' is now 'CoinName'
- 'CoinLink' is now 'AsideRowCoin'
- 'ExternalCoinLink' is now 'AsideRowCoinExternal'
- 'WalletCoinLink' is now 'AsideRowCoinWallet'
This commit is contained in:
Vasek Mlejnsky 2018-08-15 08:41:54 +02:00
parent 9d55216bf9
commit bb94eb7ed0
6 changed files with 27 additions and 27 deletions

View File

@ -7,7 +7,7 @@ import colors from 'config/colors';
import { FONT_SIZE, TRANSITION_TIME } from 'config/variables';
import { coinProp } from './common';
import CoinLogo from './CoinLogo';
import CoinName from './CoinName';
const Wrapper = styled.div`
display: flex;
@ -26,9 +26,9 @@ const Wrapper = styled.div`
}
`;
const CoinLink = ({ coin, iconRight }) => (
const AsideRowCoin = ({ coin, iconRight }) => (
<Wrapper>
<CoinLogo
<CoinName
coinImg={coin.img}
text={coin.name}
/>
@ -41,7 +41,7 @@ const CoinLink = ({ coin, iconRight }) => (
</Wrapper>
);
CoinLink.propTypes = {
AsideRowCoin.propTypes = {
...coinProp,
iconRight: PropTypes.shape({
type: PropTypes.string.isRequired,
@ -49,4 +49,4 @@ CoinLink.propTypes = {
}),
};
export default CoinLink;
export default AsideRowCoin;

View File

@ -6,15 +6,15 @@ import ICONS from 'constants/icons';
import colors from 'config/colors';
import { coinProp } from './common';
import CoinLink from './CoinLink';
import AsideRowCoin from './AsideRowCoin';
const A = styled.a`
display: block;
`;
const ExternalCoinLink = ({ coin, url }) => (
const AsideRowCoinExternal = ({ coin, url }) => (
<A href={url}>
<CoinLink
<AsideRowCoin
coin={coin}
iconRight={{
type: ICONS.REDIRECT,
@ -24,9 +24,9 @@ const ExternalCoinLink = ({ coin, url }) => (
</A>
);
ExternalCoinLink.propTypes = {
AsideRowCoinExternal.propTypes = {
...coinProp,
url: PropTypes.string,
};
export default ExternalCoinLink;
export default AsideRowCoinExternal;

View File

@ -4,21 +4,21 @@ import PropTypes from 'prop-types';
import { NavLink } from 'react-router-dom';
import { coinProp } from './common';
import CoinLink from './CoinLink';
import AsideRowCoin from './AsideRowCoin';
const Wrapper = styled(NavLink)`
display: block;
`;
const WalletCoinLink = ({ coin, url }) => (
const AsideRowCoinWallet = ({ coin, url }) => (
<Wrapper to={url}>
<CoinLink coin={coin}/>
<AsideRowCoin coin={coin}/>
</Wrapper>
);
WalletCoinLink.propTypes = {
AsideRowCoinWallet.propTypes = {
...coinProp,
url: PropTypes.string.isRequired,
};
export default WalletCoinLink;
export default AsideRowCoinWallet;

View File

@ -13,7 +13,6 @@ const Wrapper = styled.div`
p {
color: ${colors.TEXT_PRIMARY};
}
`;
const Logo = styled.div`
@ -27,7 +26,7 @@ const Logo = styled.div`
background-image: url('images/${props => props.coinImg}-logo.png');
`;
const CoinLogo = ({ coinImg, text }) => (
const CoinName = ({ coinImg, text }) => (
<Wrapper>
<Logo
coinImg={coinImg}
@ -36,9 +35,9 @@ const CoinLogo = ({ coinImg, text }) => (
</Wrapper>
);
CoinLogo.propTypes = {
CoinName.propTypes = {
coinImg: PropTypes.string.isRequired,
text: PropTypes.string.isRequired,
};
export default CoinLogo
export default CoinName

View File

@ -4,7 +4,8 @@ import styled from 'styled-components';
import React from 'react';
import { NavLink } from 'react-router-dom';
import { ExternalCoinLink, WalletCoinLink } from './CoinLink/';
import AsideRowCoinWallet from './AsideRowCoinWallet';
import AsideRowCoinExternal from './AsideRowCoinExternal';
import AsideDivider from './AsideDivider';
import type { TrezorDevice } from 'flowtype';
@ -41,7 +42,7 @@ const CoinSelection = (props: Props): React$Element<string> => {
}
return (
<WalletCoinLink
<AsideRowCoinWallet
key={item.network}
coin={{
img: coinImg,
@ -60,42 +61,42 @@ const CoinSelection = (props: Props): React$Element<string> => {
textRight={'(You will be redirected)'}
/>
<ExternalCoinLink
<AsideRowCoinExternal
coin={{
img: 'btc',
name: 'Bitcoin',
}}
url={'https://wallet.trezor.io/#/coin/ltc'}
/>
<ExternalCoinLink
<AsideRowCoinExternal
coin={{
img: 'ltc',
name: 'Litecoin',
}}
url={'https://wallet.trezor.io/#/coin/ltc'}
/>
<ExternalCoinLink
<AsideRowCoinExternal
coin={{
img: 'bch',
name: 'Bitcoin Cash',
}}
url={'https://wallet.trezor.io/#/coin/bch'}
/>
<ExternalCoinLink
<AsideRowCoinExternal
coin={{
img: 'btg',
name: 'Bitcoin Gold',
}}
url={'https://wallet.trezor.io/#/coin/btg'}
/>
<ExternalCoinLink
<AsideRowCoinExternal
coin={{
img: 'Dash',
name: 'Dash',
}}
url={'https://wallet.trezor.io/#/coin/dash'}
/>
<ExternalCoinLink
<AsideRowCoinExternal
coin={{
img: 'zec',
name: 'Zcash',