Skip to content

Commit

Permalink
chore: remove second inner scroll bar from tx details (#29412)
Browse files Browse the repository at this point in the history
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/29412?quickstart=1)

This PR removes the 2nd inner scrollbar from Bridge tx details.

## **Related issues**

Fixes:

## **Manual testing steps**

1. Do a bridge tx
2. Get navigated to Activity list
3. Click on a bridge tx
4. Observe only 1 scroll bar

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->


![Screenshot 2024-12-20 at 5 03
15 PM](https://github.com/user-attachments/assets/52904de2-7264-4959-bf23-6301eb1b7000)

### **After**

<!-- [screenshots/recordings] -->


![Screenshot 2024-12-20 at 5 19
06 PM](https://github.com/user-attachments/assets/744401eb-80bf-4726-8ee4-844068a54978)

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
  • Loading branch information
infiniteflower authored Jan 7, 2025
1 parent d9129d1 commit dabf173
Show file tree
Hide file tree
Showing 2 changed files with 186 additions and 189 deletions.
4 changes: 4 additions & 0 deletions ui/pages/bridge/transaction-details/index.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
.bridge-transaction-details {
&__content {
overflow-y: hidden;
}

&__icon-loading {
animation: loading-dot 1.2s linear infinite;
}
Expand Down
371 changes: 182 additions & 189 deletions ui/pages/bridge/transaction-details/transaction-details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -254,208 +254,201 @@ const CrossChainSwapTxDetails = () => {
);

return (
<div className="bridge">
<div className="bridge__container">
<Header
className="bridge__header"
startAccessory={
<ButtonIcon
iconName={IconName.ArrowLeft}
size={ButtonIconSize.Sm}
ariaLabel={t('back')}
onClick={() => history.goBack()}
/>
}
<div className="bridge__container">
<Header
className="bridge__header"
startAccessory={
<ButtonIcon
iconName={IconName.ArrowLeft}
size={ButtonIconSize.Sm}
ariaLabel={t('back')}
onClick={() => history.goBack()}
/>
}
>
{t('bridge')} details
</Header>
<Content className="bridge-transaction-details__content">
<Box
display={Display.Flex}
flexDirection={FlexDirection.Column}
gap={4}
>
{t('bridge')} details
</Header>
<Content className="bridge__content">
{/* Delayed banner */}
{isDelayed && (
<BannerAlert
title={t('bridgeTxDetailsDelayedTitle')}
severity={BannerAlertSeverity.Warning}
>
<Text display={Display.Flex} alignItems={AlignItems.center}>
{t('bridgeTxDetailsDelayedDescription')}&nbsp;
<ButtonLink
externalLink
href={SUPPORT_REQUEST_LINK}
onClick={() => {
trackEvent(
{
category: MetaMetricsEventCategory.Home,
event: MetaMetricsEventName.SupportLinkClicked,
properties: {
url: SUPPORT_REQUEST_LINK,
location: 'Bridge Tx Details',
},
},
{
contextPropsIntoEventProperties: [
MetaMetricsContextProp.PageTitle,
],
},
);
}}
>
{t('bridgeTxDetailsDelayedDescriptionSupport')}
</ButtonLink>
.
</Text>
</BannerAlert>
)}

{/* Bridge step list */}
{status !== StatusTypes.COMPLETE &&
(bridgeHistoryItem || srcChainTxMeta) && (
<BridgeStepList
bridgeHistoryItem={bridgeHistoryItem}
srcChainTxMeta={srcChainTxMeta}
networkConfigurationsByChainId={networkConfigurationsByChainId}
/>
)}

{/* Links to block explorers */}
<BridgeExplorerLinks
srcChainId={srcNetwork?.chainId}
destChainId={destNetwork?.chainId}
srcBlockExplorerUrl={srcBlockExplorerUrl}
destBlockExplorerUrl={destBlockExplorerUrl}
/>

<Divider />

{/* Bridge tx details */}
<Box
display={Display.Flex}
flexDirection={FlexDirection.Column}
gap={4}
gap={2}
>
{/* Delayed banner */}
{isDelayed && (
<BannerAlert
title={t('bridgeTxDetailsDelayedTitle')}
severity={BannerAlertSeverity.Warning}
>
<Text display={Display.Flex} alignItems={AlignItems.center}>
{t('bridgeTxDetailsDelayedDescription')}&nbsp;
<ButtonLink
externalLink
href={SUPPORT_REQUEST_LINK}
onClick={() => {
trackEvent(
{
category: MetaMetricsEventCategory.Home,
event: MetaMetricsEventName.SupportLinkClicked,
properties: {
url: SUPPORT_REQUEST_LINK,
location: 'Bridge Tx Details',
},
},
{
contextPropsIntoEventProperties: [
MetaMetricsContextProp.PageTitle,
],
},
);
}}
>
{t('bridgeTxDetailsDelayedDescriptionSupport')}
</ButtonLink>
.
<TransactionDetailRow
title={t('bridgeTxDetailsStatus')}
value={
<Text
textTransform={TextTransform.Capitalize}
color={status ? StatusToColorMap[status] : undefined}
>
{status?.toLowerCase()}
</Text>
</BannerAlert>
)}

{/* Bridge step list */}
{status !== StatusTypes.COMPLETE &&
(bridgeHistoryItem || srcChainTxMeta) && (
<BridgeStepList
bridgeHistoryItem={bridgeHistoryItem}
srcChainTxMeta={srcChainTxMeta}
networkConfigurationsByChainId={
networkConfigurationsByChainId
}
/>
)}

{/* Links to block explorers */}
<BridgeExplorerLinks
srcChainId={srcNetwork?.chainId}
destChainId={destNetwork?.chainId}
srcBlockExplorerUrl={srcBlockExplorerUrl}
destBlockExplorerUrl={destBlockExplorerUrl}
}
/>
<TransactionDetailRow
title={t('bridgeTxDetailsBridging')}
value={
<Box
display={Display.Flex}
gap={1}
alignItems={AlignItems.center}
>
{srcNetworkIconName}
<Icon name={IconName.Arrow2Right} size={IconSize.Sm} />
{destNetworkIconName}
</Box>
}
/>
<TransactionDetailRow
title={t('bridgeTxDetailsTimestamp')}
value={t('bridgeTxDetailsTimestampValue', [
formatDate(srcChainTxMeta?.time, 'MMM d, yyyy'),
formatDate(srcChainTxMeta?.time, 'hh:mm a'),
])}
/>
</Box>

<Divider />

{/* Bridge tx details */}
<Box
display={Display.Flex}
flexDirection={FlexDirection.Column}
gap={2}
>
<TransactionDetailRow
title={t('bridgeTxDetailsStatus')}
value={
<Text
textTransform={TextTransform.Capitalize}
color={status ? StatusToColorMap[status] : undefined}
>
{status?.toLowerCase()}
</Text>
}
/>
<TransactionDetailRow
title={t('bridgeTxDetailsBridging')}
value={
<Box
display={Display.Flex}
gap={1}
alignItems={AlignItems.center}
>
{srcNetworkIconName}
<Icon name={IconName.Arrow2Right} size={IconSize.Sm} />
{destNetworkIconName}
</Box>
}
/>
<TransactionDetailRow
title={t('bridgeTxDetailsTimestamp')}
value={t('bridgeTxDetailsTimestampValue', [
formatDate(srcChainTxMeta?.time, 'MMM d, yyyy'),
formatDate(srcChainTxMeta?.time, 'hh:mm a'),
])}
/>
</Box>

<Divider />
<Divider />

{/* Bridge tx details 2 */}
<Box
display={Display.Flex}
flexDirection={FlexDirection.Column}
gap={2}
>
<TransactionDetailRow
title={t('bridgeTxDetailsYouSent')}
value={
<Box
display={Display.Flex}
gap={1}
alignItems={AlignItems.center}
>
{t('bridgeTxDetailsTokenAmountOnChain', [
bridgeAmountSent,
bridgeHistoryItem?.quote.srcAsset.symbol,
])}
{srcNetworkIconName}
</Box>
}
/>
{bridgeAmountReceived &&
bridgeHistoryItem?.quote.destAsset.symbol && (
<TransactionDetailRow
title={t('bridgeTxDetailsYouReceived')}
value={
<Box
display={Display.Flex}
gap={1}
alignItems={AlignItems.center}
>
{t('bridgeTxDetailsTokenAmountOnChain', [
bridgeAmountReceived,
bridgeHistoryItem.quote.destAsset.symbol,
])}
{destNetworkIconName}
</Box>
}
/>
)}
<TransactionDetailRow
title={t('bridgeTxDetailsTotalGasFee')}
value={
<UserPreferencedCurrencyDisplay
currency={data?.nativeCurrency}
denomination={EtherDenomination.ETH}
numberOfDecimals={6}
value={data?.hexGasTotal}
type={PRIMARY}
/>
}
/>
</Box>
{/* Bridge tx details 2 */}
<Box
display={Display.Flex}
flexDirection={FlexDirection.Column}
gap={2}
>
<TransactionDetailRow
title={t('bridgeTxDetailsYouSent')}
value={
<Box
display={Display.Flex}
gap={1}
alignItems={AlignItems.center}
>
{t('bridgeTxDetailsTokenAmountOnChain', [
bridgeAmountSent,
bridgeHistoryItem?.quote.srcAsset.symbol,
])}
{srcNetworkIconName}
</Box>
}
/>
<TransactionDetailRow
title={t('bridgeTxDetailsYouReceived')}
value={
<Box
display={Display.Flex}
gap={1}
alignItems={AlignItems.center}
>
{t('bridgeTxDetailsTokenAmountOnChain', [
bridgeAmountReceived,
bridgeHistoryItem?.quote.destAsset.symbol,
])}
{destNetworkIconName}
</Box>
}
/>
<TransactionDetailRow
title={t('bridgeTxDetailsTotalGasFee')}
value={
<UserPreferencedCurrencyDisplay
currency={data?.nativeCurrency}
denomination={EtherDenomination.ETH}
numberOfDecimals={6}
value={data?.hexGasTotal}
type={PRIMARY}
/>
}
/>
</Box>

<Divider />
<Divider />

{/* Generic tx details */}
<Box
display={Display.Flex}
flexDirection={FlexDirection.Column}
gap={2}
>
<TransactionDetailRow
title={t('bridgeTxDetailsNonce')}
value={
srcChainTxMeta?.txParams.nonce
? hexToDecimal(srcChainTxMeta?.txParams.nonce)
: undefined
}
/>
{/* Generic tx details */}
<Box
display={Display.Flex}
flexDirection={FlexDirection.Column}
gap={2}
>
<TransactionDetailRow
title={t('bridgeTxDetailsNonce')}
value={
srcChainTxMeta?.txParams.nonce
? hexToDecimal(srcChainTxMeta?.txParams.nonce)
: undefined
}
/>

<TransactionActivityLog
transactionGroup={transactionGroup}
className="transaction-list-item-details__transaction-activity-log"
isEarliestNonce={isEarliestNonce}
/>
</Box>
<TransactionActivityLog
transactionGroup={transactionGroup}
className="transaction-list-item-details__transaction-activity-log"
isEarliestNonce={isEarliestNonce}
/>
</Box>
</Content>
</div>
</Box>
</Content>
</div>
);
};
Expand Down

0 comments on commit dabf173

Please sign in to comment.