aboutsummaryrefslogtreecommitdiffstats
path: root/old-ui/app/components/coinbase-form.js
diff options
context:
space:
mode:
authorLe Quoc Viet <vietlq85@gmail.com>2018-03-15 16:11:42 +0800
committerGitHub <noreply@github.com>2018-03-15 16:11:42 +0800
commit04079455e36e48433cf8055c8f1f79e1e7e18298 (patch)
treed7de2a6603b67b56abacf09bee4d2bbbfe886b8f /old-ui/app/components/coinbase-form.js
parent5bdee96e73f65a0b369277e9c56b0afe5159e65b (diff)
parente2efc91aee64072c408ab509219dcbfb389c7609 (diff)
downloadtangerine-wallet-browser-04079455e36e48433cf8055c8f1f79e1e7e18298.tar.gz
tangerine-wallet-browser-04079455e36e48433cf8055c8f1f79e1e7e18298.tar.zst
tangerine-wallet-browser-04079455e36e48433cf8055c8f1f79e1e7e18298.zip
Merge pull request #1 from MetaMask/master
Merge from the source
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..1a1b77b50
--- /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.goHome()),
+ }, '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',
+ })
+}