mirror of
https://github.com/trezor/trezor-wallet
synced 2025-01-23 14:31:07 +00:00
same height icons, center with flexbox
This commit is contained in:
parent
5fb9656f2b
commit
56a14f0aa7
@ -5,35 +5,22 @@ import PropTypes from 'prop-types';
|
||||
const Wrapper = styled.div`
|
||||
padding-right: 20px;
|
||||
width: 40px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
`;
|
||||
|
||||
const Logo = styled.img`
|
||||
width: ${props => (props.hasLongIcon ? '15px' : '23px')};
|
||||
margin-left: ${props => (props.hasLongIcon ? '3px' : '0px')};
|
||||
height: 23px;
|
||||
display: block;
|
||||
`;
|
||||
|
||||
class CoinLogo extends PureComponent {
|
||||
constructor() {
|
||||
super();
|
||||
this.longIcons = ['etc', 'eth', 'trop'];
|
||||
}
|
||||
|
||||
hasLongIcon(network) {
|
||||
let hasLongIcon = false;
|
||||
if (this.longIcons.includes(network)) {
|
||||
hasLongIcon = true;
|
||||
}
|
||||
return hasLongIcon;
|
||||
}
|
||||
|
||||
render() {
|
||||
const { network, className, standalone } = this.props;
|
||||
|
||||
const logo = (
|
||||
<Logo
|
||||
className={className}
|
||||
hasLongIcon={this.hasLongIcon(network)}
|
||||
src={require(`images/coins/${network}.png`)} // eslint-disable-line
|
||||
/>
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user