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

Fixes shapeshift coin selection dropdown. (#3416)

This commit is contained in:
Dan J Miller 2018-03-05 13:33:46 -03:30 committed by GitHub
parent 0d97ff2210
commit 1bd18cebd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 6 deletions

View File

@ -90,6 +90,7 @@ function mapStateToProps (state) {
isMouseUser: state.appState.isMouseUser, isMouseUser: state.appState.isMouseUser,
betaUI: state.metamask.featureFlags.betaUI, betaUI: state.metamask.featureFlags.betaUI,
isRevealingSeedWords: state.metamask.isRevealingSeedWords, isRevealingSeedWords: state.metamask.isRevealingSeedWords,
Qr: state.appState.Qr,
// state needed to get account dropdown temporarily rendering from app bar // state needed to get account dropdown temporarily rendering from app bar
identities, identities,
@ -368,6 +369,7 @@ App.prototype.renderPrimary = function () {
isOnboarding, isOnboarding,
betaUI, betaUI,
isRevealingSeedWords, isRevealingSeedWords,
Qr,
} = props } = props
const isMascaraOnboarding = isMascara && isOnboarding const isMascaraOnboarding = isMascara && isOnboarding
const isBetaUIOnboarding = betaUI && isOnboarding && !props.isPopup && !isRevealingSeedWords const isBetaUIOnboarding = betaUI && isOnboarding && !props.isPopup && !isRevealingSeedWords
@ -508,7 +510,7 @@ App.prototype.renderPrimary = function () {
width: '285px', width: '285px',
}, },
}, [ }, [
h(QrView, {key: 'qr'}), h(QrView, {key: 'qr', Qr}),
]), ]),
]) ])

View File

@ -51,8 +51,7 @@ ShapeshiftForm.prototype.componentWillMount = function () {
this.props.shapeShiftSubview() this.props.shapeShiftSubview()
} }
ShapeshiftForm.prototype.onCoinChange = function (e) { ShapeshiftForm.prototype.onCoinChange = function (coin) {
const coin = e.target.value
this.setState({ this.setState({
depositCoin: coin, depositCoin: coin,
errorMessage: '', errorMessage: '',
@ -133,7 +132,7 @@ ShapeshiftForm.prototype.renderMarketInfo = function () {
} }
ShapeshiftForm.prototype.renderQrCode = function () { ShapeshiftForm.prototype.renderQrCode = function () {
const { depositAddress, isLoading } = this.state const { depositAddress, isLoading, depositCoin } = this.state
const qrImage = qrcode(4, 'M') const qrImage = qrcode(4, 'M')
qrImage.addData(depositAddress) qrImage.addData(depositAddress)
qrImage.make() qrImage.make()
@ -141,7 +140,7 @@ ShapeshiftForm.prototype.renderQrCode = function () {
return h('div.shapeshift-form', {}, [ return h('div.shapeshift-form', {}, [
h('div.shapeshift-form__deposit-instruction', [ h('div.shapeshift-form__deposit-instruction', [
'Deposit your BTC to the address below:', `Deposit your ${depositCoin.toUpperCase()} to the address below:`,
]), ]),
h('div', depositAddress), h('div', depositAddress),
@ -182,7 +181,7 @@ ShapeshiftForm.prototype.render = function () {
h(SimpleDropdown, { h(SimpleDropdown, {
selectedOption: this.state.depositCoin, selectedOption: this.state.depositCoin,
onSelect: this.onCoinChange, onSelect: (coin) => this.onCoinChange(coin),
options: Object.entries(coinOptions).map(([coin]) => ({ options: Object.entries(coinOptions).map(([coin]) => ({
value: coin.toLowerCase(), value: coin.toLowerCase(),
displayValue: coin, displayValue: coin,