aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/coinbase-form.js
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2017-07-21 03:38:38 +0800
committerDan Finlay <dan@danfinlay.com>2017-07-21 03:38:38 +0800
commit86d367957fe8ac04462f716fe0ba2bfa4e5ff3f6 (patch)
treeb4a6805e5e2a4de48c880d80f4b87d1f3b560a18 /ui/app/components/coinbase-form.js
parent199587383b022a17d56adcb56d6a99ceba71fec7 (diff)
downloadtangerine-wallet-browser-86d367957fe8ac04462f716fe0ba2bfa4e5ff3f6.tar.gz
tangerine-wallet-browser-86d367957fe8ac04462f716fe0ba2bfa4e5ff3f6.tar.zst
tangerine-wallet-browser-86d367957fe8ac04462f716fe0ba2bfa4e5ff3f6.zip
Move responsive ui into its own folder for easier merges
Diffstat (limited to 'ui/app/components/coinbase-form.js')
-rw-r--r--ui/app/components/coinbase-form.js63
1 files changed, 63 insertions, 0 deletions
diff --git a/ui/app/components/coinbase-form.js b/ui/app/components/coinbase-form.js
new file mode 100644
index 000000000..f44d86045
--- /dev/null
+++ b/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('../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',
+ })
+}