2017-08-09 03:34:04 +02:00
|
|
|
const Component = require('react').Component
|
|
|
|
const h = require('react-hyperscript')
|
|
|
|
const inherits = require('util').inherits
|
|
|
|
const connect = require('react-redux').connect
|
2017-08-21 04:10:49 +02:00
|
|
|
const actions = require('../../actions')
|
2017-08-09 03:34:04 +02:00
|
|
|
|
|
|
|
function mapStateToProps (state) {
|
|
|
|
return {
|
|
|
|
network: state.metamask.network,
|
2017-08-09 03:37:20 +02:00
|
|
|
address: state.metamask.selectedAddress,
|
2017-08-09 03:34:04 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function mapDispatchToProps (dispatch) {
|
|
|
|
return {
|
2017-08-09 03:37:20 +02:00
|
|
|
toCoinbase: (address) => {
|
2017-08-09 03:34:04 +02:00
|
|
|
dispatch(actions.buyEth({ network: '1', address, amount: 0 }))
|
|
|
|
},
|
2017-08-10 01:27:55 +02:00
|
|
|
hideModal: () => {
|
|
|
|
dispatch(actions.hideModal())
|
2017-08-29 16:50:48 +02:00
|
|
|
},
|
2017-09-22 06:26:10 +02:00
|
|
|
showAccountDetailModal: () => {
|
|
|
|
dispatch(actions.showModal({ name: 'ACCOUNT_DETAILS' }))
|
|
|
|
},
|
2017-08-09 03:34:04 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
inherits(BuyOptions, Component)
|
|
|
|
function BuyOptions () {
|
|
|
|
Component.call(this)
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = connect(mapStateToProps, mapDispatchToProps)(BuyOptions)
|
|
|
|
|
|
|
|
BuyOptions.prototype.render = function () {
|
|
|
|
return h('div', {}, [
|
2017-08-21 13:46:38 +02:00
|
|
|
h('div.buy-modal-content.transfers-subview', {
|
2017-08-09 03:34:04 +02:00
|
|
|
}, [
|
2017-08-21 13:46:38 +02:00
|
|
|
h('div.buy-modal-content-title-wrapper.flex-column.flex-center', {
|
2017-08-09 03:34:04 +02:00
|
|
|
style: {},
|
|
|
|
}, [
|
2017-08-21 13:46:38 +02:00
|
|
|
h('div.buy-modal-content-title', {
|
2017-08-09 03:34:04 +02:00
|
|
|
style: {},
|
|
|
|
}, 'Transfers'),
|
2017-10-23 07:59:55 +02:00
|
|
|
h('div', {}, 'How would you like to deposit Ether?'),
|
2017-08-09 03:34:04 +02:00
|
|
|
]),
|
|
|
|
|
2017-08-21 13:46:38 +02:00
|
|
|
h('div.buy-modal-content-options.flex-column.flex-center', {}, [
|
2017-08-09 03:34:04 +02:00
|
|
|
|
2017-08-21 13:46:38 +02:00
|
|
|
h('div.buy-modal-content-option', {
|
2017-08-09 03:37:20 +02:00
|
|
|
onClick: () => {
|
|
|
|
const { toCoinbase, address } = this.props
|
|
|
|
toCoinbase(address)
|
|
|
|
},
|
|
|
|
}, [
|
2017-08-21 13:46:38 +02:00
|
|
|
h('div.buy-modal-content-option-title', {}, 'Coinbase'),
|
2017-10-23 07:59:55 +02:00
|
|
|
h('div.buy-modal-content-option-subtitle', {}, 'Deposit with Fiat'),
|
2017-08-09 03:34:04 +02:00
|
|
|
]),
|
|
|
|
|
2017-09-29 01:34:42 +02:00
|
|
|
// h('div.buy-modal-content-option', {}, [
|
|
|
|
// h('div.buy-modal-content-option-title', {}, 'Shapeshift'),
|
|
|
|
// h('div.buy-modal-content-option-subtitle', {}, 'Trade any digital asset for any other'),
|
|
|
|
// ]),
|
2017-08-09 03:34:04 +02:00
|
|
|
|
2017-09-22 06:26:10 +02:00
|
|
|
h('div.buy-modal-content-option', {
|
2017-09-29 01:34:42 +02:00
|
|
|
onClick: () => this.goToAccountDetailsModal(),
|
2017-09-22 06:26:10 +02:00
|
|
|
}, [
|
2017-08-21 13:46:38 +02:00
|
|
|
h('div.buy-modal-content-option-title', {}, 'Direct Deposit'),
|
|
|
|
h('div.buy-modal-content-option-subtitle', {}, 'Deposit from another account'),
|
2017-08-09 03:34:04 +02:00
|
|
|
]),
|
|
|
|
|
|
|
|
]),
|
|
|
|
|
2017-08-10 01:27:55 +02:00
|
|
|
h('button', {
|
|
|
|
style: {
|
|
|
|
background: 'white',
|
|
|
|
},
|
|
|
|
onClick: () => { this.props.hideModal() },
|
2017-08-29 16:50:48 +02:00
|
|
|
}, h('div.buy-modal-content-footer#buy-modal-content-footer-text', {}, 'Cancel')),
|
|
|
|
]),
|
2017-08-09 03:34:04 +02:00
|
|
|
])
|
|
|
|
}
|
2017-09-22 06:26:10 +02:00
|
|
|
|
|
|
|
BuyOptions.prototype.goToAccountDetailsModal = function () {
|
|
|
|
this.props.hideModal()
|
|
|
|
this.props.showAccountDetailModal()
|
|
|
|
}
|