Skip to content

Commit 7c43148

Browse files
authored
fix: dapp swap design fixes (#38626)
<!-- 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** Design fixesin dapp swap banner. ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: ## **Related issues** NA ## **Manual testing steps** 1. Submit swap command 2. Check style of banner and ensure they align with designs ## **Screenshots/Recordings** <img width="389" height="610" alt="Screenshot 2025-12-08 at 6 46 04 PM" src="https://github.com/user-attachments/assets/259bbd72-b41c-43eb-b683-019b89088497" /> ## **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 - [X] I’ve included tests if applicable - [X] 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. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Increase banner text size to BodySm, add medium weight heading, and update rewards text color to accent01-normal. > > - **UI — `ui/pages/.../dapp-swap-comparison-banner.tsx`** > - Increase text variants from `BodyXs` to `BodySm` for quote difference, divider dot, rewards text, and benefits line. > - Add `fontWeight={FontWeight.Medium}` to callout heading. > - Use optional chaining for `rewards?.text`. > - **Styles — `ui/pages/.../dapp-swap-comparison-banner/index.scss`** > - Update rewards text color from `--color-accent01-light` to `--color-accent01-normal`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 435fab8. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 6850973 commit 7c43148

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

ui/pages/confirmations/components/confirm/dapp-swap-comparison-banner/dapp-swap-comparison-banner.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
BoxFlexDirection,
88
ButtonIcon,
99
ButtonIconSize,
10+
FontWeight,
1011
IconName,
1112
Text,
1213
TextColor,
@@ -187,6 +188,7 @@ const DappSwapComparisonInner = () => {
187188
<Text
188189
className="dapp-swap_callout-text"
189190
color={TextColor.TextDefault}
191+
fontWeight={FontWeight.Medium}
190192
variant={TextVariant.BodySm}
191193
>
192194
{rewards ? t('dappSwapAdvantage') : t('dappSwapAdvantageSaveOnly')}
@@ -195,9 +197,8 @@ const DappSwapComparisonInner = () => {
195197
flexDirection={BoxFlexDirection.Row}
196198
alignItems={BoxAlignItems.Center}
197199
gap={2}
198-
marginBottom={2}
199200
>
200-
<Text color={TextColor.SuccessDefault} variant={TextVariant.BodyXs}>
201+
<Text color={TextColor.SuccessDefault} variant={TextVariant.BodySm}>
201202
{t('dappSwapQuoteDifference', [
202203
`$${selectedQuoteValueDifference.toFixed(2)}`,
203204
])}
@@ -206,20 +207,20 @@ const DappSwapComparisonInner = () => {
206207
<>
207208
<Text
208209
color={TextColor.TextAlternative}
209-
variant={TextVariant.BodyXs}
210+
variant={TextVariant.BodySm}
210211
>
211212
{` • `}
212213
</Text>
213214
<Text
214215
className="dapp-swap_text-rewards"
215-
variant={TextVariant.BodyXs}
216+
variant={TextVariant.BodySm}
216217
>
217-
{rewards.text}
218+
{rewards?.text}
218219
</Text>
219220
</>
220221
)}
221222
</Box>
222-
<Text color={TextColor.TextAlternative} variant={TextVariant.BodyXs}>
223+
<Text color={TextColor.TextAlternative} variant={TextVariant.BodySm}>
223224
{t('dappSwapBenefits')}
224225
</Text>
225226
</Box>

ui/pages/confirmations/components/confirm/dapp-swap-comparison-banner/index.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Disabling Stylelint's hex color rule here because the TypeScript migration dashb
4646
}
4747

4848
&_text-rewards {
49-
color: var(--color-accent01-light);
49+
color: var(--color-accent01-normal);
5050
}
5151

5252
&_callout-arrow {

0 commit comments

Comments
 (0)