1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Convert buy subview to new tab bar component

This commit is contained in:
Dan Finlay 2016-11-04 12:02:00 -07:00
parent 1bbe0ed9e8
commit 1af0d609bd

View File

@ -7,6 +7,7 @@ const CoinbaseForm = require('./coinbase-form')
const ShapeshiftForm = require('./shapeshift-form') const ShapeshiftForm = require('./shapeshift-form')
const extension = require('../../../app/scripts/lib/extension') const extension = require('../../../app/scripts/lib/extension')
const Loading = require('./loading') const Loading = require('./loading')
const TabBar = require('./tab-bar')
module.exports = connect(mapStateToProps)(BuyButtonSubview) module.exports = connect(mapStateToProps)(BuyButtonSubview)
@ -53,43 +54,53 @@ BuyButtonSubview.prototype.render = function () {
h(Loading, { isLoading }), h(Loading, { isLoading }),
h('h3.flex-row.text-transform-uppercase', { h(TabBar, {
style: { tabs: [
background: '#EBEBEB', {
color: '#AEAEAE', content: [
paddingTop: '4px', 'Coinbase',
justifyContent: 'space-around', h('a', {
}, onClick: (event) => this.navigateTo('https://github.com/MetaMask/faq/blob/master/COINBASE.md'),
}, [ }, [
h(currentForm.coinbase ? '.activeForm' : '.inactiveForm.pointer', { h('i.fa.fa-question-circle', {
onClick: () => props.dispatch(actions.coinBaseSubview()), style: {
}, 'Coinbase'), margin: '0px 5px',
h('a', { },
onClick: (event) => this.navigateTo('https://github.com/MetaMask/faq/blob/master/COINBASE.md'), }),
}, [ ]),
h('i.fa.fa-question-circle', { ],
style: { key: 'coinbase'
position: 'relative', },
right: '33px', {
}, content: [
}), 'Shapeshift',
]), h('a', {
h(currentForm.shapeshift ? '.activeForm' : '.inactiveForm.pointer', { href: 'https://github.com/MetaMask/faq/blob/master/COINBASE.md',
onClick: () => props.dispatch(actions.shapeShiftSubview(props.provider.type)), onClick: (event) => this.navigateTo('https://info.shapeshift.io/about'),
}, 'Shapeshift'), }, [
h('i.fa.fa-question-circle', {
style: {
margin: '0px 5px',
},
}),
])
],
key: 'shapeshift'
},
],
defaultTab: 'coinbase',
tabSelected: (key) => {
switch (key) {
case 'coinbase':
props.dispatch(actions.coinBaseSubview())
break
case 'shapeshift':
props.dispatch(actions.shapeShiftSubview(props.provider.type))
break
}
}
}),
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: {
position: 'relative',
right: '28px',
},
}),
]),
]),
this.formVersionSubview(), this.formVersionSubview(),
]) ])
) )