aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/buy-options.js
diff options
context:
space:
mode:
authorsdtsui <szehungdanieltsui@gmail.com>2017-08-09 09:34:04 +0800
committersdtsui <szehungdanieltsui@gmail.com>2017-08-09 09:34:04 +0800
commitdc702705bff055ecdc67897680a5d345b03a5faa (patch)
tree0e471997c44030284ef7c8a7d87e864c1072ba65 /ui/app/components/buy-options.js
parenteab5718a40e121c6b8597df6968c25733e794c6f (diff)
downloadtangerine-wallet-browser-dc702705bff055ecdc67897680a5d345b03a5faa.tar
tangerine-wallet-browser-dc702705bff055ecdc67897680a5d345b03a5faa.tar.gz
tangerine-wallet-browser-dc702705bff055ecdc67897680a5d345b03a5faa.tar.bz2
tangerine-wallet-browser-dc702705bff055ecdc67897680a5d345b03a5faa.tar.lz
tangerine-wallet-browser-dc702705bff055ecdc67897680a5d345b03a5faa.tar.xz
tangerine-wallet-browser-dc702705bff055ecdc67897680a5d345b03a5faa.tar.zst
tangerine-wallet-browser-dc702705bff055ecdc67897680a5d345b03a5faa.zip
Move buy view into its own component - BuyOptions
Diffstat (limited to 'ui/app/components/buy-options.js')
-rw-r--r--ui/app/components/buy-options.js70
1 files changed, 70 insertions, 0 deletions
diff --git a/ui/app/components/buy-options.js b/ui/app/components/buy-options.js
new file mode 100644
index 000000000..c58e508bf
--- /dev/null
+++ b/ui/app/components/buy-options.js
@@ -0,0 +1,70 @@
+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')
+
+function mapStateToProps (state) {
+ return {
+ network: state.metamask.network,
+ }
+}
+
+function mapDispatchToProps (dispatch) {
+ return {
+ toCoinbase: () => {
+ dispatch(actions.buyEth({ network: '1', address, amount: 0 }))
+ },
+ }
+}
+
+inherits(BuyOptions, Component)
+function BuyOptions () {
+ Component.call(this)
+}
+
+module.exports = connect(mapStateToProps, mapDispatchToProps)(BuyOptions)
+
+BuyOptions.prototype.render = function () {
+ return h('div', {}, [
+ h('div.modal-content.transfers-subview', {
+
+ }, [
+ h('div.modal-content-title-wrapper.flex-column.flex-center', {
+ style: {},
+ }, [
+ h('div.modal-content-title', {
+ style: {},
+ }, 'Transfers'),
+ h('div', {}, 'How would you like to buy Ether?'),
+ ]),
+
+ h('div.modal-content-options.flex-column.flex-center', {}, [
+
+ h('div.modal-content-option', {}, [
+ h('div.modal-content-option-title', {}, 'Coinbase'),
+ h('div.modal-content-option-subtitle', {
+ onClick: () => {
+ this.props.toCoinbase()
+ },
+ }, 'Buy with Fiat'),
+ ]),
+
+ h('div.modal-content-option', {}, [
+ h('div.modal-content-option-title', {}, 'Shapeshift'),
+ h('div.modal-content-option-subtitle', {}, 'Trade any digital asset for any other'),
+ ]),
+
+ h('div.modal-content-option', {}, [
+ h('div.modal-content-option-title', {}, 'Direct Deposit'),
+ h('div.modal-content-option-subtitle', {}, 'Deposit from another account'),
+ ]),
+
+ ]),
+
+ h('div.modal-content-footer', {
+ style: {},
+ }, 'Cancel'),
+ ])
+ ])
+}