feat(pixel-perfecting): add eye on Receive view buttons

This commit is contained in:
eliabejr 2019-01-17 17:26:46 -03:00
parent 069913ebf6
commit d4ae30805f
3 changed files with 11 additions and 5 deletions

BIN
app/assets/images/eye.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

View File

@ -86,21 +86,23 @@ export const Button = ({
}: Props) => {
if (to && onClick) throw new Error('Should define either "to" or "onClick"');
const props = { onClick, disabled: disabled || isLoading, icon: null, className };
const props = {
onClick, disabled: disabled || isLoading, icon: null, className,
};
const buttonLabel = isLoading ? 'Loading...' : label;
const component = variant === 'primary' ? (
<Primary {...props}>
{icon ?
<Icon src={icon} />
{icon
? <Icon src={icon} />
: null
}
{buttonLabel}
</Primary>
) : (
<Secondary {...props}>
{icon ?
<Icon src={icon} />
{icon
? <Icon src={icon} />
: null
}
{buttonLabel}
@ -112,6 +114,7 @@ export const Button = ({
Button.defaultProps = {
to: '',
icon: null,
variant: 'primary',
onClick: null,
disabled: false,

View File

@ -8,6 +8,8 @@ import { QRCode } from './qrcode';
import truncateAddress from '../utils/truncateAddress';
import eyeIcon from '../assets/images/eye.png';
const AddressWrapper = styled.div`
align-items: center;
display: flex;
@ -82,6 +84,7 @@ export class WalletAddress extends Component<Props, State> {
onFocus={event => event.currentTarget.select()}
/>
<Button
icon={eyeIcon}
label={`${isVisible ? 'Hide' : 'Show'} full address and QR Code`}
onClick={toggleVisibility}
variant='secondary'