Skip to content

Commit

Permalink
Remove AccountDropdownMini component
Browse files Browse the repository at this point in the history
The `AccountDropdownMini` component featured the ability to switch
accounts using a dropdown, but this functionality was disabled in MetaMask#6024.
It has been acting as a restyled `AccountListItem` since then.

The component has been removed, and the style changes moved to the sole
parent component (`RequestSignature`).
  • Loading branch information
Gudahtt committed Jul 24, 2019
1 parent 754f98a commit 22f9280
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 257 deletions.
24 changes: 9 additions & 15 deletions ui/app/components/app/signature-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const { compose } = require('recompose')
const { withRouter } = require('react-router-dom')
const { ObjectInspector } = require('react-inspector')

import AccountDropdownMini from '../ui/account-dropdown-mini'
import AccountListItem from '../../pages/send/account-list-item/account-list-item.component'

const actions = require('../../store/actions')
const { conversionUtil } = require('../../helpers/utils/conversion-util')
Expand All @@ -21,7 +21,6 @@ const {
getSelectedAccount,
getCurrentAccountWithSendEtherInfo,
getSelectedAddress,
accountsWithSendEtherInfoSelector,
conversionRateSelector,
} = require('../../selectors/selectors.js')

Expand All @@ -37,7 +36,6 @@ function mapStateToProps (state) {
selectedAddress: getSelectedAddress(state),
requester: null,
requesterAddress: null,
accounts: accountsWithSendEtherInfoSelector(state),
conversionRate: conversionRateSelector(state),
}
}
Expand Down Expand Up @@ -137,23 +135,19 @@ SignatureRequest.prototype.renderHeader = function () {
])
}

SignatureRequest.prototype.renderAccountDropdown = function () {
SignatureRequest.prototype.renderAccount = function () {
const { selectedAccount } = this.state

const {
accounts,
} = this.props

return h('div.request-signature__account', [

h('div.request-signature__account-text', [this.context.t('account') + ':']),

h(AccountDropdownMini, {
selectedAccount,
accounts,
disabled: true,
}),

h('div.request-signature__account-item', [
h(AccountListItem, {
account: selectedAccount,
displayBalance: false,
}),
]),
])
}

Expand All @@ -180,7 +174,7 @@ SignatureRequest.prototype.renderBalance = function () {
SignatureRequest.prototype.renderAccountInfo = function () {
return h('div.request-signature__account-info', [

this.renderAccountDropdown(),
this.renderAccount(),

this.renderRequestIcon(),

Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion ui/app/components/ui/account-dropdown-mini/index.js

This file was deleted.

This file was deleted.

48 changes: 0 additions & 48 deletions ui/app/css/itcss/components/account-dropdown-mini.scss

This file was deleted.

2 changes: 0 additions & 2 deletions ui/app/css/itcss/components/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@

@import './account-details-dropdown.scss';

@import './account-dropdown-mini.scss';

@import './editable-label.scss';

@import './pages/index.scss';
Expand Down
24 changes: 24 additions & 0 deletions ui/app/css/itcss/components/request-signature.scss
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,30 @@
font-size: 14px;
}

&__account-item {
height: 22px;
background-color: $white;
font-family: Roboto;
line-height: 16px;
font-size: 12px;
width: 124px;

.account-list-item {
margin-top: 6px;
}

.account-list-item__account-name {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
width: 80px;
}

.account-list-item__top-row {
margin: 0;
}
}

&__balance {
color: $dusty-gray;
margin-right: 17px;
Expand Down

0 comments on commit 22f9280

Please sign in to comment.