Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add Portfolio button to BTC accounts #28184

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions test/e2e/flask/btc/btc-account-overview.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,8 @@ describe('BTC Account - Overview', function (this: Suite) {
// buy sell button
await driver.findClickableElement('[data-testid="coin-overview-buy"]');

// receive button
await driver.findClickableElement(
'[data-testid="coin-overview-receive"]',
);
// portfolio button
await driver.findClickableElement('[data-testid="portfolio-link"]');
},
);
});
Expand Down
65 changes: 23 additions & 42 deletions ui/components/app/wallet-overview/coin-overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,49 +193,30 @@ export const CoinOverview = ({
///: END:ONLY_INCLUDE_IF

const renderPercentageAndAmountChange = () => {
if (isEvm) {
if (showNativeTokenAsMainBalance) {
return (
<Box className="wallet-overview__currency-wrapper">
<PercentageAndAmountChange
value={tokensMarketData?.[zeroAddress()]?.pricePercentChange1d}
/>
{
///: BEGIN:ONLY_INCLUDE_IF(build-main,build-beta,build-flask)
<ButtonLink
endIconName={IconName.Export}
onClick={handlePortfolioOnClick}
as="a"
data-testid="portfolio-link"
textProps={{ variant: TextVariant.bodyMdMedium }}
>
{t('portfolio')}
</ButtonLink>
///: END:ONLY_INCLUDE_IF
}
</Box>
);
}
return (
<Box className="wallet-overview__currency-wrapper">
return (
<Box className="wallet-overview__currency-wrapper">
{isEvm && showNativeTokenAsMainBalance ? (
<PercentageAndAmountChange
value={tokensMarketData?.[zeroAddress()]?.pricePercentChange1d}
/>
) : (
<AggregatedPercentageOverview />
{
///: BEGIN:ONLY_INCLUDE_IF(build-main,build-beta,build-flask)
<ButtonLink
endIconName={IconName.Export}
onClick={handlePortfolioOnClick}
as="a"
data-testid="portfolio-link"
textProps={{ variant: TextVariant.bodyMdMedium }}
>
{t('portfolio')}
</ButtonLink>
///: END:ONLY_INCLUDE_IF
}
</Box>
);
}
return null;
)}
{
///: BEGIN:ONLY_INCLUDE_IF(build-main,build-beta,build-flask)
<ButtonLink
endIconName={IconName.Export}
onClick={handlePortfolioOnClick}
as="a"
data-testid="portfolio-link"
textProps={{ variant: TextVariant.bodyMdMedium }}
>
{t('portfolio')}
</ButtonLink>
///: END:ONLY_INCLUDE_IF
}
</Box>
);
};

return (
Expand Down
Loading