diff options
Shapeshift deposit tx modal.
Diffstat (limited to 'ui/app/components')
-rw-r--r-- | ui/app/components/modals/account-modal-container.js | 6 | ||||
-rw-r--r-- | ui/app/components/modals/modal.js | 8 | ||||
-rw-r--r-- | ui/app/components/modals/shapeshift-deposit-tx-modal.js | 40 | ||||
-rw-r--r-- | ui/app/components/tx-list.js | 2 |
4 files changed, 54 insertions, 2 deletions
diff --git a/ui/app/components/modals/account-modal-container.js b/ui/app/components/modals/account-modal-container.js index 3cad72067..c548fb7b3 100644 --- a/ui/app/components/modals/account-modal-container.js +++ b/ui/app/components/modals/account-modal-container.js @@ -30,10 +30,14 @@ module.exports = connect(mapStateToProps, mapDispatchToProps)(AccountModalContai AccountModalContainer.prototype.render = function () { const { selectedIdentity, - children, showBackButton = false, backButtonAction, } = this.props + let { children } = this.props + + if (children.constructor !== Array) { + children = [children] + } return h('div', { style: { borderRadius: '4px' }}, [ h('div.account-modal-container', [ diff --git a/ui/app/components/modals/modal.js b/ui/app/components/modals/modal.js index 2bd56fb0a..765e46312 100644 --- a/ui/app/components/modals/modal.js +++ b/ui/app/components/modals/modal.js @@ -13,6 +13,7 @@ const AccountDetailsModal = require('./account-details-modal') const EditAccountNameModal = require('./edit-account-name-modal') const ExportPrivateKeyModal = require('./export-private-key-modal') const NewAccountModal = require('./new-account-modal') +const ShapeshiftDepositTxModal = require('./shapeshift-deposit-tx-modal.js') const accountModalStyle = { mobileModalStyle: { @@ -109,6 +110,13 @@ const MODALS = { ...accountModalStyle, }, + SHAPESHIFT_DEPOSIT_TX: { + contents: [ + h(ShapeshiftDepositTxModal), + ], + ...accountModalStyle, + }, + NEW_ACCOUNT: { contents: [ h(NewAccountModal, {}, []), diff --git a/ui/app/components/modals/shapeshift-deposit-tx-modal.js b/ui/app/components/modals/shapeshift-deposit-tx-modal.js new file mode 100644 index 000000000..1fd1ade00 --- /dev/null +++ b/ui/app/components/modals/shapeshift-deposit-tx-modal.js @@ -0,0 +1,40 @@ +const Component = require('react').Component +const h = require('react-hyperscript') +const inherits = require('util').inherits +const connect = require('react-redux').connect +const actions = require('../../actions') +const QrView = require('../qr-code') +const AccountModalContainer = require('./account-modal-container') + +function mapStateToProps (state) { + return { + Qr: state.appState.modal.modalState.Qr, + } +} + +function mapDispatchToProps (dispatch) { + return { + hideModal: () => { + dispatch(actions.hideModal()) + }, + } +} + +inherits(ShapeshiftDepositTxModal, Component) +function ShapeshiftDepositTxModal () { + Component.call(this) + +} + +module.exports = connect(mapStateToProps, mapDispatchToProps)(ShapeshiftDepositTxModal) + +ShapeshiftDepositTxModal.prototype.render = function () { + const { Qr } = this.props + + return h(AccountModalContainer, { + }, [ + h('div', {}, [ + h(QrView, {key: 'qr', Qr}), + ]) + ]) +} diff --git a/ui/app/components/tx-list.js b/ui/app/components/tx-list.js index 82541704e..97d937aca 100644 --- a/ui/app/components/tx-list.js +++ b/ui/app/components/tx-list.js @@ -57,7 +57,7 @@ TxList.prototype.renderTransaction = function () { TxList.prototype.renderTransactionListItem = function (transaction, conversionRate) { // console.log({transaction}) // refer to transaction-list.js:line 58 - const shapeshiftProps = {}; + if (transaction.key === 'shapeshift') { return h(ShiftListItem, transaction) } |