aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/qr-code.js
diff options
context:
space:
mode:
authorFrankie <frankie.pangilinan@consensys.net>2016-08-13 06:41:59 +0800
committerFrankie <frankie.pangilinan@consensys.net>2016-08-13 06:41:59 +0800
commitb4c9a5225947f9aadac5fd1bb23fde64740d774a (patch)
treebd6af9ce87c7cbedc6aa2a6afe0e7f6ce424b49f /ui/app/components/qr-code.js
parent2fc26fb264ba0df7e4fc60128c6cbe19d3141beb (diff)
downloadtangerine-wallet-browser-b4c9a5225947f9aadac5fd1bb23fde64740d774a.tar
tangerine-wallet-browser-b4c9a5225947f9aadac5fd1bb23fde64740d774a.tar.gz
tangerine-wallet-browser-b4c9a5225947f9aadac5fd1bb23fde64740d774a.tar.bz2
tangerine-wallet-browser-b4c9a5225947f9aadac5fd1bb23fde64740d774a.tar.lz
tangerine-wallet-browser-b4c9a5225947f9aadac5fd1bb23fde64740d774a.tar.xz
tangerine-wallet-browser-b4c9a5225947f9aadac5fd1bb23fde64740d774a.tar.zst
tangerine-wallet-browser-b4c9a5225947f9aadac5fd1bb23fde64740d774a.zip
Change buy forms so that they are their own view and add Qr-code
Diffstat (limited to 'ui/app/components/qr-code.js')
-rw-r--r--ui/app/components/qr-code.js50
1 files changed, 50 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..765322239
--- /dev/null
+++ b/ui/app/components/qr-code.js
@@ -0,0 +1,50 @@
+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',
+ },
+ }, [
+ 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,
+ }),
+ ]),
+ ])
+}