1
0
mirror of https://github.com/trezor/trezor-wallet synced 2025-07-05 14:22:35 +00:00

Apply button's icon margin only when button contains text

This commit is contained in:
Vasek Mlejnsky 2018-08-30 12:16:31 +02:00
parent c32c30fa8c
commit 325b5bee63

View File

@ -109,7 +109,7 @@ const Wrapper = styled.button`
`; `;
const IconWrapper = styled.span` const IconWrapper = styled.span`
margin-right: 8px; ${props => (props.hasText ? 'margin-right: 8px;' : '')};
`; `;
const Button = ({ const Button = ({
@ -126,7 +126,9 @@ const Button = ({
isTransparent={isTransparent} isTransparent={isTransparent}
> >
{icon && ( {icon && (
<IconWrapper> <IconWrapper
hasText={!!text}
>
<Icon <Icon
icon={icon.type} icon={icon.type}
color={icon.color} color={icon.color}