aboutsummaryrefslogtreecommitdiffstats
path: root/old-ui/app/components/coinbase-form.js
diff options
context:
space:
mode:
authorAlexander Tseung <alextsg@gmail.com>2017-12-23 03:00:46 +0800
committerAlexander Tseung <alextsg@gmail.com>2017-12-23 03:00:46 +0800
commit06410381d4b738fe22aa24973c7f9568d295f570 (patch)
tree69bd8701cdaa417cb6c0f46deff43414122101db /old-ui/app/components/coinbase-form.js
parent06f496310ce7d719bbb5690f307db143ba57a1a7 (diff)
parenta218008adf85dfb5fa8ca93c789e14d9f2090813 (diff)
downloadtangerine-wallet-browser-06410381d4b738fe22aa24973c7f9568d295f570.tar.gz
tangerine-wallet-browser-06410381d4b738fe22aa24973c7f9568d295f570.tar.zst
tangerine-wallet-browser-06410381d4b738fe22aa24973c7f9568d295f570.zip
Merge branch 'NewUI-flat' into merge-master
Diffstat (limited to 'old-ui/app/components/coinbase-form.js')
-rw-r--r--old-ui/app/components/coinbase-form.js63
1 files changed, 63 insertions, 0 deletions
diff --git a/old-ui/app/components/coinbase-form.js b/old-ui/app/components/coinbase-form.js
new file mode 100644
index 000000000..35b2111ff
--- /dev/null
+++ b/old-ui/app/components/coinbase-form.js
@@ -0,0 +1,63 @@
+const Component = require('react').Component
+const h = require('react-hyperscript')
+const inherits = require('util').inherits
+const connect = require('react-redux').connect
+const actions = require('../../../ui/app/actions')
+
+module.exports = connect(mapStateToProps)(CoinbaseForm)
+
+function mapStateToProps (state) {
+ return {
+ warning: state.appState.warning,
+ }
+}
+
+inherits(CoinbaseForm, Component)
+
+function CoinbaseForm () {
+ Component.call(this)
+}
+
+CoinbaseForm.prototype.render = function () {
+ var props = this.props
+
+ return h('.flex-column', {
+ style: {
+ marginTop: '35px',
+ padding: '25px',
+ width: '100%',
+ },
+ }, [
+ h('.flex-row', {
+ style: {
+ justifyContent: 'space-around',
+ margin: '33px',
+ marginTop: '0px',
+ },
+ }, [
+ h('button.btn-green', {
+ onClick: this.toCoinbase.bind(this),
+ }, 'Continue to Coinbase'),
+
+ h('button.btn-red', {
+ onClick: () => props.dispatch(actions.backTobuyView(props.accounts.address)),
+ }, 'Cancel'),
+ ]),
+ ])
+}
+
+CoinbaseForm.prototype.toCoinbase = function () {
+ const props = this.props
+ const address = props.buyView.buyAddress
+ props.dispatch(actions.buyEth({ network: '1', address, amount: 0 }))
+}
+
+CoinbaseForm.prototype.renderLoading = function () {
+ return h('img', {
+ style: {
+ width: '27px',
+ marginRight: '-27px',
+ },
+ src: 'images/loading.svg',
+ })
+}