diff --git a/src/renderer/component/common/qr-code.jsx b/src/renderer/component/common/qr-code.jsx index fb74c68d7..41b506bc5 100644 --- a/src/renderer/component/common/qr-code.jsx +++ b/src/renderer/component/common/qr-code.jsx @@ -6,22 +6,27 @@ import classnames from 'classnames'; type Props = { value: string, paddingRight?: boolean, + paddingTop?: boolean, + size?: number, }; class QRCode extends React.Component { static defaultProps = { paddingRight: false, + paddingTop: false, + size: 128, }; render() { - const { value, paddingRight } = this.props; + const { value, paddingRight, paddingTop, size } = this.props; return (
- +
); } diff --git a/src/renderer/component/walletAddress/view.jsx b/src/renderer/component/walletAddress/view.jsx index 81f7cec4f..208416a2a 100644 --- a/src/renderer/component/walletAddress/view.jsx +++ b/src/renderer/component/walletAddress/view.jsx @@ -2,6 +2,7 @@ import React from 'react'; import Button from 'component/button'; import Address from 'component/address'; +import QRCode from 'component/common/qr-code'; import * as icons from 'constants/icons'; type Props = { @@ -12,6 +13,20 @@ type Props = { }; class WalletAddress extends React.PureComponent { + constructor(props: Props) { + super(props); + + this.state = { + showQR: false, + }; + } + + toggleQR() { + this.setState({ + showQR: !this.state.showQR, + }); + } + componentWillMount() { const { checkAddressIsMine, receiveAddress, getNewAddress } = this.props; if (!receiveAddress) { @@ -23,6 +38,7 @@ class WalletAddress extends React.PureComponent { render() { const { receiveAddress, getNewAddress, gettingNewAddress } = this.props; + const { showQR } = this.state; return (
@@ -43,7 +59,17 @@ class WalletAddress extends React.PureComponent { onClick={getNewAddress} disabled={gettingNewAddress} /> +