mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-23 02:10:12 +01:00
Move TokenCell styles alongside component (#8257)
The styles for the TokenCell component have been moved to be alongside the component. They have also been renamed from `token-list-item` to match the component name.
This commit is contained in:
parent
d82f06c710
commit
f7504d153e
@ -995,7 +995,7 @@ describe('MetaMask', function () {
|
|||||||
|
|
||||||
await driver.clickElement(By.css('.wallet-balance'))
|
await driver.clickElement(By.css('.wallet-balance'))
|
||||||
|
|
||||||
await driver.clickElement(By.css('.token-list-item'))
|
await driver.clickElement(By.css('.token-cell'))
|
||||||
await driver.delay(1000)
|
await driver.delay(1000)
|
||||||
|
|
||||||
const tokenBalanceAmount = await driver.findElements(By.css('.transaction-view-balance__primary-balance'))
|
const tokenBalanceAmount = await driver.findElements(By.css('.transaction-view-balance__primary-balance'))
|
||||||
@ -1223,7 +1223,7 @@ describe('MetaMask', function () {
|
|||||||
|
|
||||||
describe('Hide token', function () {
|
describe('Hide token', function () {
|
||||||
it('hides the token when clicked', async function () {
|
it('hides the token when clicked', async function () {
|
||||||
await driver.clickElement(By.css('.token-list-item__ellipsis'))
|
await driver.clickElement(By.css('.token-cell__ellipsis'))
|
||||||
|
|
||||||
const byTokenMenuDropdownOption = By.css('.menu__item--clickable')
|
const byTokenMenuDropdownOption = By.css('.menu__item--clickable')
|
||||||
await driver.clickElement(byTokenMenuDropdownOption)
|
await driver.clickElement(byTokenMenuDropdownOption)
|
||||||
|
@ -48,6 +48,8 @@
|
|||||||
|
|
||||||
@import '../ui/token-balance/index';
|
@import '../ui/token-balance/index';
|
||||||
|
|
||||||
|
@import 'token-cell/token-cell';
|
||||||
|
|
||||||
@import 'transaction-activity-log/index';
|
@import 'transaction-activity-log/index';
|
||||||
|
|
||||||
@import 'transaction-breakdown/index';
|
@import 'transaction-breakdown/index';
|
||||||
|
@ -55,15 +55,15 @@ describe('Token Cell', function () {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('renders token balance', function () {
|
it('renders token balance', function () {
|
||||||
assert.equal(wrapper.find('.token-list-item__token-balance').text(), '5.000')
|
assert.equal(wrapper.find('.token-cell__token-balance').text(), '5.000')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('renders token symbol', function () {
|
it('renders token symbol', function () {
|
||||||
assert.equal(wrapper.find('.token-list-item__token-symbol').text(), 'TEST')
|
assert.equal(wrapper.find('.token-cell__token-symbol').text(), 'TEST')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('renders converted fiat amount', function () {
|
it('renders converted fiat amount', function () {
|
||||||
assert.equal(wrapper.find('.token-list-item__fiat-amount').text(), '0.52 USD')
|
assert.equal(wrapper.find('.token-cell__fiat-amount').text(), '0.52 USD')
|
||||||
})
|
})
|
||||||
|
|
||||||
})
|
})
|
||||||
|
@ -64,29 +64,29 @@ export default class TokenCell extends Component {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={classnames(`token-list-item`, {
|
className={classnames('token-cell', {
|
||||||
'token-list-item--active': selectedTokenAddress === address,
|
'token-cell--active': selectedTokenAddress === address,
|
||||||
})}
|
})}
|
||||||
onClick={onClick.bind(null, address)}
|
onClick={onClick.bind(null, address)}
|
||||||
>
|
>
|
||||||
<Identicon
|
<Identicon
|
||||||
className="token-list-item__identicon"
|
className="token-cell__identicon"
|
||||||
diameter={50}
|
diameter={50}
|
||||||
address={address}
|
address={address}
|
||||||
image={image}
|
image={image}
|
||||||
/>
|
/>
|
||||||
<div className="token-list-item__balance-ellipsis">
|
<div className="token-cell__balance-ellipsis">
|
||||||
<div className="token-list-item__balance-wrapper">
|
<div className="token-cell__balance-wrapper">
|
||||||
<div className="token-list-item__token-balance">{string || 0}</div>
|
<div className="token-cell__token-balance">{string || 0}</div>
|
||||||
<div className="token-list-item__token-symbol">{symbol}</div>
|
<div className="token-cell__token-symbol">{symbol}</div>
|
||||||
{showFiat && (
|
{showFiat && (
|
||||||
<div className="token-list-item__fiat-amount">
|
<div className="token-cell__fiat-amount">
|
||||||
{formattedFiat}
|
{formattedFiat}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<i
|
<i
|
||||||
className="fa fa-ellipsis-h fa-lg token-list-item__ellipsis cursor-pointer"
|
className="fa fa-ellipsis-h fa-lg token-cell__ellipsis cursor-pointer"
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
this.setState({ tokenMenuOpen: true })
|
this.setState({ tokenMenuOpen: true })
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
$wallet-balance-breakpoint: 890px;
|
$wallet-balance-breakpoint: 890px;
|
||||||
$wallet-balance-breakpoint-range: "screen and (min-width: #{$break-large}) and (max-width: #{$wallet-balance-breakpoint})";
|
$wallet-balance-breakpoint-range: "screen and (min-width: #{$break-large}) and (max-width: #{$wallet-balance-breakpoint})";
|
||||||
|
|
||||||
.token-list-item {
|
.token-cell {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-flow: row nowrap;
|
flex-flow: row nowrap;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -121,4 +121,4 @@ $wallet-balance-breakpoint-range: "screen and (min-width: #{$break-large}) and (
|
|||||||
line-height: 21px;
|
line-height: 21px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -61,15 +61,15 @@ describe('Token Cell', function () {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('renders token balance', function () {
|
it('renders token balance', function () {
|
||||||
assert.equal(wrapper.find('.token-list-item__token-balance').text(), '5.000')
|
assert.equal(wrapper.find('.token-cell__token-balance').text(), '5.000')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('renders token symbol', function () {
|
it('renders token symbol', function () {
|
||||||
assert.equal(wrapper.find('.token-list-item__token-symbol').text(), 'TEST')
|
assert.equal(wrapper.find('.token-cell__token-symbol').text(), 'TEST')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('renders converted fiat amount', function () {
|
it('renders converted fiat amount', function () {
|
||||||
assert.equal(wrapper.find('.token-list-item__fiat-amount').text(), '0.52 USD')
|
assert.equal(wrapper.find('.token-cell__fiat-amount').text(), '0.52 USD')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('calls onClick when clicked', function () {
|
it('calls onClick when clicked', function () {
|
||||||
|
@ -31,8 +31,6 @@
|
|||||||
|
|
||||||
@import './sections.scss';
|
@import './sections.scss';
|
||||||
|
|
||||||
@import './token-list.scss';
|
|
||||||
|
|
||||||
@import './currency-display.scss';
|
@import './currency-display.scss';
|
||||||
|
|
||||||
@import './menu.scss';
|
@import './menu.scss';
|
||||||
|
Loading…
Reference in New Issue
Block a user