aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/buy-button-subview.js
diff options
context:
space:
mode:
authorfrankiebee <frankie.diamond@gmail.com>2017-04-19 00:21:24 +0800
committerfrankiebee <frankie.diamond@gmail.com>2017-04-19 05:22:17 +0800
commitce03b7db51570295c7868382cf997dbb1bc5725a (patch)
treeef0a79a8aff59253de4fa6f6406cf3695f38ca41 /ui/app/components/buy-button-subview.js
parent83811910c84342094be4ac94dca829e8f5ff630f (diff)
downloadtangerine-wallet-browser-ce03b7db51570295c7868382cf997dbb1bc5725a.tar
tangerine-wallet-browser-ce03b7db51570295c7868382cf997dbb1bc5725a.tar.gz
tangerine-wallet-browser-ce03b7db51570295c7868382cf997dbb1bc5725a.tar.bz2
tangerine-wallet-browser-ce03b7db51570295c7868382cf997dbb1bc5725a.tar.lz
tangerine-wallet-browser-ce03b7db51570295c7868382cf997dbb1bc5725a.tar.xz
tangerine-wallet-browser-ce03b7db51570295c7868382cf997dbb1bc5725a.tar.zst
tangerine-wallet-browser-ce03b7db51570295c7868382cf997dbb1bc5725a.zip
Initial redo attempt of the buy view to look like vladt's desighn
Diffstat (limited to 'ui/app/components/buy-button-subview.js')
-rw-r--r--ui/app/components/buy-button-subview.js139
1 files changed, 88 insertions, 51 deletions
diff --git a/ui/app/components/buy-button-subview.js b/ui/app/components/buy-button-subview.js
index 6810303e1..8d3e9aa21 100644
--- a/ui/app/components/buy-button-subview.js
+++ b/ui/app/components/buy-button-subview.js
@@ -6,12 +6,15 @@ const actions = require('../actions')
const CoinbaseForm = require('./coinbase-form')
const ShapeshiftForm = require('./shapeshift-form')
const Loading = require('./loading')
-const TabBar = require('./tab-bar')
+const AccountPanel = require('./account-panel')
+const RadioList = require('./custom-radio-list')
module.exports = connect(mapStateToProps)(BuyButtonSubview)
function mapStateToProps (state) {
return {
+ identity: state.appState.identity,
+ account: state.metamask.accounts[state.appState.buyView.buyAddress],
warning: state.appState.warning,
buyView: state.appState.buyView,
network: state.metamask.network,
@@ -31,7 +34,11 @@ BuyButtonSubview.prototype.render = function () {
const isLoading = props.isSubLoading
return (
- h('.buy-eth-section', [
+ h('.buy-eth-section.flex-column', {
+ style: {
+ alignItems: 'center',
+ },
+ }, [
// back button
h('.flex-row', {
style: {
@@ -46,58 +53,79 @@ BuyButtonSubview.prototype.render = function () {
left: '10px',
},
}),
- h('h2.page-subtitle', 'Buy Eth'),
- ]),
-
- h(Loading, { isLoading }),
-
- h(TabBar, {
- tabs: [
- {
- content: [
- 'Coinbase',
- h('a', {
- onClick: (event) => this.navigateTo('https://github.com/MetaMask/faq/blob/master/COINBASE.md'),
- }, [
- h('i.fa.fa-question-circle', {
- style: {
- margin: '0px 5px',
- },
- }),
- ]),
- ],
- key: 'coinbase',
+ h('h2.text-transform-uppercase.flex-center', {
+ style: {
+ width: '100vw',
+ background: 'rgb(235, 235, 235)',
+ color: 'rgb(174, 174, 174)',
+ paddingTop: '4px',
+ paddingBottom: '4px',
},
- {
- content: [
- 'Shapeshift',
- h('a', {
- href: 'https://github.com/MetaMask/faq/blob/master/COINBASE.md',
- onClick: (event) => this.navigateTo('https://info.shapeshift.io/about'),
- }, [
- h('i.fa.fa-question-circle', {
- style: {
- margin: '0px 5px',
- },
- }),
- ]),
- ],
- key: 'shapeshift',
+ }, 'Buy Eth'),
+ ]),
+ h('div', {
+ style: {
+ position: 'absolute',
+ top: '57vh',
+ left: '49vw',
+ },
+ }, [
+ h(Loading, {isLoading}),
+ ]),
+ h('div', {
+ style: {
+ width: '80%',
+ },
+ }, [
+ h(AccountPanel, {
+ showFullAddress: true,
+ identity: props.identity,
+ account: props.account,
+ }),
+ ]),
+ h('h3.text-transform-uppercase', {
+ style: {
+ paddingLeft: '15px',
+ fontFamily: 'Montserrat Light',
+ width: '100vw',
+ background: 'rgb(235, 235, 235)',
+ color: 'rgb(174, 174, 174)',
+ paddingTop: '4px',
+ paddingBottom: '4px',
+ },
+ }, 'Select Service'),
+ h('.flex-row.selected-exchange', {
+ style: {
+ position: 'relative',
+ right: '35px',
+ marginTop: '20px',
+ marginBottom: '20px',
+ },
+ }, [
+ h(RadioList, {
+ defaultFocus: props.buyView.subview,
+ lables: [
+ 'Coinbase',
+ 'ShapeShift',
+ ],
+ subtext: {
+ 'Coinbase': 'Crypto/FIAT (USA only)',
+ 'ShapeShift': 'Crypto',
},
- ],
- defaultTab: 'coinbase',
- tabSelected: (key) => {
- switch (key) {
- case 'coinbase':
- props.dispatch(actions.coinBaseSubview())
- break
- case 'shapeshift':
- props.dispatch(actions.shapeShiftSubview(props.provider.type))
- break
- }
+ onClick: this.radioHandler.bind(this),
+ }),
+ ]),
+ h('h3.text-transform-uppercase', {
+ style: {
+ paddingLeft: '15px',
+ fontFamily: 'Montserrat Light',
+ width: '100vw',
+ background: 'rgb(235, 235, 235)',
+ color: 'rgb(174, 174, 174)',
+ paddingTop: '4px',
+ paddingBottom: '4px',
},
- }),
-
+ }, props.buyView.subview),
this.formVersionSubview(),
])
)
@@ -152,3 +180,12 @@ BuyButtonSubview.prototype.backButtonContext = function () {
this.props.dispatch(actions.goHome())
}
}
+
+BuyButtonSubview.prototype.radioHandler = function (event) {
+ switch (event.target.title) {
+ case 'Coinbase':
+ return this.props.dispatch(actions.coinBaseSubview())
+ case 'ShapeShift':
+ return this.props.dispatch(actions.shapeShiftSubview(this.props.provider.type))
+ }
+}