aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/qr-code.js
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2017-07-04 06:39:25 +0800
committerDan Finlay <dan@danfinlay.com>2017-07-04 06:39:25 +0800
commit5eb3d5d485b17b98b19443d8def2f03dec9b38ef (patch)
tree1b814f7706a9eb559824624b87937631ac3ca505 /ui/app/components/qr-code.js
parentd0d01552da8d0a6f58fb7c5be16947175ec90267 (diff)
downloadtangerine-wallet-browser-5eb3d5d485b17b98b19443d8def2f03dec9b38ef.tar
tangerine-wallet-browser-5eb3d5d485b17b98b19443d8def2f03dec9b38ef.tar.gz
tangerine-wallet-browser-5eb3d5d485b17b98b19443d8def2f03dec9b38ef.tar.bz2
tangerine-wallet-browser-5eb3d5d485b17b98b19443d8def2f03dec9b38ef.tar.lz
tangerine-wallet-browser-5eb3d5d485b17b98b19443d8def2f03dec9b38ef.tar.xz
tangerine-wallet-browser-5eb3d5d485b17b98b19443d8def2f03dec9b38ef.tar.zst
tangerine-wallet-browser-5eb3d5d485b17b98b19443d8def2f03dec9b38ef.zip
Make folder for responsive UI
Diffstat (limited to 'ui/app/components/qr-code.js')
-rw-r--r--ui/app/components/qr-code.js79
1 files changed, 0 insertions, 79 deletions
diff --git a/ui/app/components/qr-code.js b/ui/app/components/qr-code.js
deleted file mode 100644
index 06b9aed9b..000000000
--- a/ui/app/components/qr-code.js
+++ /dev/null
@@ -1,79 +0,0 @@
-const Component = require('react').Component
-const h = require('react-hyperscript')
-const qrCode = require('qrcode-npm').qrcode
-const inherits = require('util').inherits
-const connect = require('react-redux').connect
-const isHexPrefixed = require('ethereumjs-util').isHexPrefixed
-const CopyButton = require('./copyButton')
-
-module.exports = connect(mapStateToProps)(QrCodeView)
-
-function mapStateToProps (state) {
- return {
- Qr: state.appState.Qr,
- buyView: state.appState.buyView,
- warning: state.appState.warning,
- }
-}
-
-inherits(QrCodeView, Component)
-
-function QrCodeView () {
- Component.call(this)
-}
-
-QrCodeView.prototype.render = function () {
- const props = this.props
- const Qr = props.Qr
- const address = `${isHexPrefixed(Qr.data) ? 'ethereum:' : ''}${Qr.data}`
- const qrImage = qrCode(4, 'M')
- qrImage.addData(address)
- qrImage.make()
- return h('.main-container.flex-column', {
- key: 'qr',
- style: {
- justifyContent: 'center',
- paddingBottom: '45px',
- paddingLeft: '45px',
- paddingRight: '45px',
- alignItems: 'center',
- },
- }, [
- Array.isArray(Qr.message) ? h('.message-container', this.renderMultiMessage()) : h('.qr-header', Qr.message),
-
- this.props.warning ? this.props.warning && h('span.error.flex-center', {
- style: {
- textAlign: 'center',
- width: '229px',
- height: '82px',
- },
- },
- this.props.warning) : null,
-
- h('#qr-container.flex-column', {
- style: {
- marginTop: '25px',
- marginBottom: '15px',
- },
- dangerouslySetInnerHTML: {
- __html: qrImage.createTableTag(4),
- },
- }),
- h('.flex-row', [
- h('h3.ellip-address', {
- style: {
- width: '247px',
- },
- }, 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
-}