diff options
author | kumavis <kumavis@users.noreply.github.com> | 2016-08-14 23:18:20 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-14 23:18:20 +0800 |
commit | f7a5a4e170538792f00aa8f05d46144734f361d2 (patch) | |
tree | fa0cad900c2834039055cdf26d4671adee40fe74 /ui/app/components/qr-code.js | |
parent | 4572e689cf3feef22d49ee71f1465a11b305a13c (diff) | |
parent | 31d6d5c50916a98c7cdc1cf898eeb9a046a60c72 (diff) | |
download | tangerine-wallet-browser-f7a5a4e170538792f00aa8f05d46144734f361d2.tar tangerine-wallet-browser-f7a5a4e170538792f00aa8f05d46144734f361d2.tar.gz tangerine-wallet-browser-f7a5a4e170538792f00aa8f05d46144734f361d2.tar.bz2 tangerine-wallet-browser-f7a5a4e170538792f00aa8f05d46144734f361d2.tar.lz tangerine-wallet-browser-f7a5a4e170538792f00aa8f05d46144734f361d2.tar.xz tangerine-wallet-browser-f7a5a4e170538792f00aa8f05d46144734f361d2.tar.zst tangerine-wallet-browser-f7a5a4e170538792f00aa8f05d46144734f361d2.zip |
Merge pull request #529 from MetaMask/buyForm
Buy form
Diffstat (limited to 'ui/app/components/qr-code.js')
-rw-r--r-- | ui/app/components/qr-code.js | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/ui/app/components/qr-code.js b/ui/app/components/qr-code.js new file mode 100644 index 000000000..1c744b234 --- /dev/null +++ b/ui/app/components/qr-code.js @@ -0,0 +1,56 @@ +const Component = require('react').Component +const h = require('react-hyperscript') +const inherits = require('util').inherits +const connect = require('react-redux').connect +const CopyButton = require('./copyButton') + +module.exports = connect(mapStateToProps)(QrCodeView) + +function mapStateToProps (state) { + return { + Qr: state.appState.Qr, + buyView: state.appState.buyView, + } +} + +inherits(QrCodeView, Component) + +function QrCodeView () { + Component.call(this) +} + +QrCodeView.prototype.render = function () { + var props = this.props + var Qr = props.Qr + return h('.main-container.flex-column', { + style: { + justifyContent: 'center', + padding: '45px', + alignItems: 'center', + }, + }, [ + Array.isArray(Qr.message) ? h('.message-container', this.renderMultiMessage()) : h('h3', Qr.message), + h('#qr-container.flex-column', { + key: 'qr', + style: { + marginTop: '25px', + marginBottom: '15px', + }, + dangerouslySetInnerHTML: { + __html: Qr.image, + }, + }), + h('.flex-row', [ + h('h3.ellip-address', Qr.data), + h(CopyButton, { + value: Qr.data, + }), + ]), + ]) +} + +QrCodeView.prototype.renderMultiMessage = function () { + var Qr = this.props.Qr + var multiMessage = Qr.message.map((message) => h('.qr-message', message)) + return multiMessage +} |