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

Updating current currency from send form.

This commit is contained in:
Dan 2017-08-25 17:31:56 -02:30
parent ff247289ae
commit 05e6eaf171
2 changed files with 23 additions and 1 deletions

View File

@ -73,6 +73,14 @@
.send-screen-bolt-icon {} .send-screen-bolt-icon {}
.selected-currency {
color: $curious-blue;
}
.unselected-currency {
cursor: pointer;
}
.send-screen-gas-input-customize { .send-screen-gas-input-customize {
position: absolute; position: absolute;
top: 30px; top: 30px;

View File

@ -177,7 +177,17 @@ SendTransactionScreen.prototype.render = function () {
h('div.send-screen-amount-labels', {}, [ h('div.send-screen-amount-labels', {}, [
h('span', {}, ['Amount']), h('span', {}, ['Amount']),
h('span', {}, ['ETH <> USD']), //holding on icon from design h('span', {}, [
h('span', {
className: currentCurrency === 'ETH' ? 'selected-currency' : 'unselected-currency',
onClick: this.setCurrentCurrency.bind(this, 'ETH')
}, ['ETH']),
'<>',
h('span', {
className: currentCurrency === 'USD' ? 'selected-currency' : 'unselected-currency',
onClick: this.setCurrentCurrency.bind(this, 'USD'),
}, ['USD']),
]), //holding on icon from design
]), ]),
h('input.large-input.send-screen-input', { h('input.large-input.send-screen-input', {
@ -537,6 +547,10 @@ SendTransactionScreen.prototype.setTooltipOpen = function (isOpen) {
this.setState({ tooltipIsOpen: isOpen }) this.setState({ tooltipIsOpen: isOpen })
} }
SendTransactionScreen.prototype.setCurrentCurrency = function (newCurrency) {
this.props.dispatch(actions.setCurrentCurrency(newCurrency))
}
SendTransactionScreen.prototype.navigateToAccounts = function (event) { SendTransactionScreen.prototype.navigateToAccounts = function (event) {
event.stopPropagation() event.stopPropagation()
this.props.dispatch(actions.showAccountsPage()) this.props.dispatch(actions.showAccountsPage())