diff options
author | brunobar79 <brunobar79@gmail.com> | 2018-07-24 09:27:51 +0800 |
---|---|---|
committer | brunobar79 <brunobar79@gmail.com> | 2018-07-24 09:27:51 +0800 |
commit | f7ad978474f42eb96f4f6c79376391504cf228c1 (patch) | |
tree | be472127595385f8c8558213a58b7d1a470ad760 /ui/app/components/send | |
parent | 02091486094dcc818096ce13a22cdc140a2e8347 (diff) | |
download | tangerine-wallet-browser-f7ad978474f42eb96f4f6c79376391504cf228c1.tar tangerine-wallet-browser-f7ad978474f42eb96f4f6c79376391504cf228c1.tar.gz tangerine-wallet-browser-f7ad978474f42eb96f4f6c79376391504cf228c1.tar.bz2 tangerine-wallet-browser-f7ad978474f42eb96f4f6c79376391504cf228c1.tar.lz tangerine-wallet-browser-f7ad978474f42eb96f4f6c79376391504cf228c1.tar.xz tangerine-wallet-browser-f7ad978474f42eb96f4f6c79376391504cf228c1.tar.zst tangerine-wallet-browser-f7ad978474f42eb96f4f6c79376391504cf228c1.zip |
camera working back and forth
Diffstat (limited to 'ui/app/components/send')
-rw-r--r-- | ui/app/components/send/send-content/send-content.component.js | 2 | ||||
-rw-r--r-- | ui/app/components/send/send.component.js | 12 | ||||
-rw-r--r-- | ui/app/components/send/send.container.js | 2 |
3 files changed, 15 insertions, 1 deletions
diff --git a/ui/app/components/send/send-content/send-content.component.js b/ui/app/components/send/send-content/send-content.component.js index 7a0b1a18e..566ee1c7f 100644 --- a/ui/app/components/send/send-content/send-content.component.js +++ b/ui/app/components/send/send-content/send-content.component.js @@ -11,6 +11,7 @@ export default class SendContent extends Component { static propTypes = { updateGas: PropTypes.func, + scanQrCode: PropTypes.func, }; render () { @@ -19,6 +20,7 @@ export default class SendContent extends Component { <div className="send-v2__form"> <SendFromRow /> <SendToRow updateGas={(updateData) => this.props.updateGas(updateData)} /> + <button onClick={_ => this.props.scanQrCode() }>or scan a QR code</button> <SendAmountRow updateGas={(updateData) => this.props.updateGas(updateData)} /> <SendGasRow /> <SendHexDataRow /> diff --git a/ui/app/components/send/send.component.js b/ui/app/components/send/send.component.js index 6f1b20c55..5e967251d 100644 --- a/ui/app/components/send/send.component.js +++ b/ui/app/components/send/send.component.js @@ -38,12 +38,19 @@ export default class SendTransactionScreen extends PersistentForm { updateAndSetGasTotal: PropTypes.func, updateSendErrors: PropTypes.func, updateSendTokenBalance: PropTypes.func, + scanQrCode: PropTypes.func, }; static contextTypes = { t: PropTypes.func, }; + scanQrCode = async () => { + const scannedAddress = await this.props.scanQrCode() + console.log('QR-SCANNER: Got address (UI)', scannedAddress) + this.updateGas({ to: scannedAddress }) + } + updateGas ({ to: updatedToAddress, amount: value } = {}) { const { amount, @@ -170,7 +177,10 @@ export default class SendTransactionScreen extends PersistentForm { return ( <div className="page-container"> <SendHeader history={history}/> - <SendContent updateGas={(updateData) => this.updateGas(updateData)}/> + <SendContent + updateGas={(updateData) => this.updateGas(updateData)} + scanQrCode={_ => this.scanQrCode()} + /> <SendFooter history={history}/> </div> ) diff --git a/ui/app/components/send/send.container.js b/ui/app/components/send/send.container.js index 44ebd2792..c3240be67 100644 --- a/ui/app/components/send/send.container.js +++ b/ui/app/components/send/send.container.js @@ -26,6 +26,7 @@ import { updateSendTokenBalance, updateGasData, setGasTotal, + scanQrCode, } from '../../actions' import { resetSendState, @@ -89,5 +90,6 @@ function mapDispatchToProps (dispatch) { }, updateSendErrors: newError => dispatch(updateSendErrors(newError)), resetSendState: () => dispatch(resetSendState()), + scanQrCode: () => dispatch(scanQrCode()), } } |