mirror of
https://github.com/trezor/trezor-wallet
synced 2025-01-12 09:00:58 +00:00
Revert "Refactored menu rendering - styled"
This reverts commit ce635fe979
.
This commit is contained in:
parent
ce635fe979
commit
7c1f928ac6
@ -11,7 +11,6 @@
|
|||||||
},
|
},
|
||||||
"rules": {
|
"rules": {
|
||||||
"react/destructuring-assignment": 0,
|
"react/destructuring-assignment": 0,
|
||||||
"class-methods-use-this": 0,
|
|
||||||
"react/jsx-one-expression-per-line": 0,
|
"react/jsx-one-expression-per-line": 0,
|
||||||
"react/jsx-indent": [2, 4],
|
"react/jsx-indent": [2, 4],
|
||||||
"react/jsx-indent-props": [2, 4],
|
"react/jsx-indent-props": [2, 4],
|
||||||
|
@ -1,52 +1,8 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import colors from '~/js/config/colors';
|
|
||||||
import styled from 'styled-components';
|
|
||||||
import { NavLink } from 'react-router-dom';
|
import { NavLink } from 'react-router-dom';
|
||||||
import navigationConstants from '~/js/constants/navigation';
|
import navigationConstants from '~/js/constants/navigation';
|
||||||
|
|
||||||
const Wrapper = styled.div`
|
|
||||||
padding: 0 0 20px 0;
|
|
||||||
`;
|
|
||||||
|
|
||||||
const ImgActive = styled.img`
|
|
||||||
margin-right: 20px;
|
|
||||||
`;
|
|
||||||
|
|
||||||
const ImgRedirect = styled.img`
|
|
||||||
margin-right: 15px;
|
|
||||||
`;
|
|
||||||
|
|
||||||
const Link = styled(NavLink)`
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
`;
|
|
||||||
|
|
||||||
const LinkRedirect = styled.a`
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
`;
|
|
||||||
|
|
||||||
const Divider = styled.div`
|
|
||||||
font-size: 12px;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
color: ${colors.TEXT_SECONDARY};
|
|
||||||
background: ${colors.GRAY_LIGHT};
|
|
||||||
padding: 8px 28px 8px 24px;
|
|
||||||
border-top: 1px solid ${colors.DIVIDER};
|
|
||||||
border-bottom: 1px solid ${colors.DIVIDER};
|
|
||||||
`;
|
|
||||||
|
|
||||||
const RedirectText = styled.span`
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
`;
|
|
||||||
|
|
||||||
const Name = styled.div`
|
|
||||||
height: 100%;
|
|
||||||
`;
|
|
||||||
|
|
||||||
class CoinSelection extends Component {
|
class CoinSelection extends Component {
|
||||||
getBaseUrl() {
|
getBaseUrl() {
|
||||||
const { selectedDevice } = this.props.wallet;
|
const { selectedDevice } = this.props.wallet;
|
||||||
@ -60,39 +16,30 @@ class CoinSelection extends Component {
|
|||||||
return baseUrl;
|
return baseUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
getImagePath(symbol, network) {
|
|
||||||
const coindId = (symbol === 'tETH' ? network : symbol);
|
|
||||||
return `../../../../images/${coindId}-logo.png`;
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { config } = this.props.localStorage;
|
const { config } = this.props.localStorage;
|
||||||
return (
|
return (
|
||||||
<Wrapper>
|
<section>
|
||||||
{config.coins.map(item => (
|
{config.coins.map(item => (
|
||||||
<Link
|
<NavLink
|
||||||
key={item.network}
|
key={item.network}
|
||||||
to={`${this.getBaseUrl()}/network/${item.network}/account/0`}
|
to={`${this.getBaseUrl()}/network/${item.network}/account/0`}
|
||||||
>
|
>{ item.name }
|
||||||
<ImgActive width="12px" src={this.getImagePath(item.symbol, item.network)} />
|
</NavLink>
|
||||||
<Name>{ item.name }</Name>
|
|
||||||
</Link>
|
|
||||||
))}
|
))}
|
||||||
<Divider>
|
<div className="coin-divider">
|
||||||
Other coins <RedirectText>(You will be redirected)</RedirectText>
|
Other coins <span>(You will be redirected)</span>
|
||||||
</Divider>
|
</div>
|
||||||
{navigationConstants.map(item => (
|
{navigationConstants.map(item => (
|
||||||
<LinkRedirect
|
<a
|
||||||
key={item.coinName}
|
key={item.coinName}
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
href={item.url}
|
href={item.url}
|
||||||
>
|
>{item.coinName}
|
||||||
<ImgRedirect src={item.image} width="20px" />
|
</a>
|
||||||
{item.coinName}
|
|
||||||
</LinkRedirect>
|
|
||||||
))}
|
))}
|
||||||
</Wrapper>
|
</section>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,31 +2,25 @@ export default [
|
|||||||
{
|
{
|
||||||
coinName: 'Bitcoin',
|
coinName: 'Bitcoin',
|
||||||
url: 'https://wallet.trezor.io/#/coin/btc',
|
url: 'https://wallet.trezor.io/#/coin/btc',
|
||||||
image: '../images/btc-logo.png',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
coinName: 'Litecoin',
|
coinName: 'Litecoin',
|
||||||
url: 'https://wallet.trezor.io/#/coin/ltc',
|
url: 'https://wallet.trezor.io/#/coin/ltc',
|
||||||
image: '../images/ltc-logo.png',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
coinName: 'Bitcoin Cash',
|
coinName: 'Bitcoin Cash',
|
||||||
url: 'https://wallet.trezor.io/#/coin/bch',
|
url: 'https://wallet.trezor.io/#/coin/bch',
|
||||||
image: '../images/bch-logo.png',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
coinName: 'Bitcoin Gold',
|
coinName: 'Bitcoin Gold',
|
||||||
url: 'https://wallet.trezor.io/#/coin/btg',
|
url: 'https://wallet.trezor.io/#/coin/btg',
|
||||||
image: '../images/btg-logo.png',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
coinName: 'Dash',
|
coinName: 'Dash',
|
||||||
url: 'https://wallet.trezor.io/#/coin/dash',
|
url: 'https://wallet.trezor.io/#/coin/dash',
|
||||||
image: '../images/dash-logo.png',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
coinName: 'Zcash',
|
coinName: 'Zcash',
|
||||||
url: 'https://wallet.trezor.io/#/coin/zec',
|
url: 'https://wallet.trezor.io/#/coin/zec',
|
||||||
image: '../images/zec-logo.png',
|
|
||||||
},
|
},
|
||||||
];
|
];
|
@ -415,6 +415,54 @@ aside {
|
|||||||
background-size: auto 20px;
|
background-size: auto 20px;
|
||||||
background-position: 2px 0px;
|
background-position: 2px 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
&.ethereum:before {
|
||||||
|
background-image: url('../images/eth-logo.png');
|
||||||
|
}
|
||||||
|
&.ethereum-classic:before {
|
||||||
|
background-image: url('../images/etc-logo.png');
|
||||||
|
}
|
||||||
|
&.ropsten:before {
|
||||||
|
background-image: url('../images/ropsten-logo.png');
|
||||||
|
}
|
||||||
|
&.rinkeby:before {
|
||||||
|
background-image: url('../images/rinkeby-logo.png');
|
||||||
|
}
|
||||||
|
|
||||||
|
&.btc:before {
|
||||||
|
background-image: url('../images/btc-logo.png');
|
||||||
|
}
|
||||||
|
&.bch:before {
|
||||||
|
background-image: url('../images/bch-logo.png');
|
||||||
|
}
|
||||||
|
&.btg:before {
|
||||||
|
background-image: url('../images/btg-logo.png');
|
||||||
|
}
|
||||||
|
&.ltc:before {
|
||||||
|
background-image: url('../images/ltc-logo.png');
|
||||||
|
}
|
||||||
|
&.dash:before {
|
||||||
|
background-image: url('../images/dash-logo.png');
|
||||||
|
}
|
||||||
|
&.zec:before {
|
||||||
|
background-image: url('../images/zec-logo.png');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.coin-divider {
|
||||||
|
font-size: 12px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
color: @color_text_secondary;
|
||||||
|
background: @color_gray_light;
|
||||||
|
padding: 8px 28px 8px 24px;
|
||||||
|
border-top: 1px solid @color_divider;
|
||||||
|
border-bottom: 1px solid @color_divider;
|
||||||
|
span {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.device-divider {
|
.device-divider {
|
||||||
|
Loading…
Reference in New Issue
Block a user