Skip to content

Commit

Permalink
fix: fix bug spending cap label alignment (#27338)
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?
-->

This PR addresses the spending cap label alignment. 

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

## **Related issues**

Fixes: #27114

## **Manual testing steps**

1. Go to test-dapp
2. Use "Sign Permit"
3. Verify change

## **Screenshots/Recordings**

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

### **Before**

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

### **After**

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

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [ ] 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
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.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
OGPoyraz authored Sep 24, 2024
1 parent 5cc14af commit 24811bb
Show file tree
Hide file tree
Showing 26 changed files with 3,882 additions and 2,855 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@ exports[`ConfirmInfoExpandableRow should match snapshot 1`] = `
>
<div
class="mm-box mm-box--display-flex mm-box--flex-direction-row mm-box--justify-content-center mm-box--align-items-flex-start"
style="align-items: center;"
>
<p
class="mm-box mm-text mm-text--body-md-medium mm-box--color-inherit"
<div
class="mm-box mm-box--display-flex mm-box--align-items-center"
>
Expandable Row
</p>
<p
class="mm-box mm-text mm-text--body-md-medium mm-box--color-inherit"
>
Expandable Row
</p>
</div>
</div>
<div
class="mm-box mm-box--display-flex"
Expand Down
26 changes: 16 additions & 10 deletions ui/components/app/confirm/info/row/__snapshots__/row.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@ exports[`ConfirmInfoRow should match snapshot 1`] = `
>
<div
class="mm-box mm-box--display-flex mm-box--flex-direction-row mm-box--justify-content-center mm-box--align-items-flex-start"
style="align-items: center;"
>
<p
class="mm-box mm-text mm-text--body-md-medium mm-box--color-inherit"
<div
class="mm-box mm-box--display-flex mm-box--align-items-center"
>
some label
</p>
<p
class="mm-box mm-text mm-text--body-md-medium mm-box--color-inherit"
>
some label
</p>
</div>
</div>
<p
class="mm-box mm-text mm-text--body-md mm-box--color-text-default"
Expand All @@ -37,13 +40,16 @@ exports[`ConfirmInfoRow should match snapshot when copy is enabled 1`] = `
/>
<div
class="mm-box mm-box--display-flex mm-box--flex-direction-row mm-box--justify-content-center mm-box--align-items-flex-start"
style="align-items: center;"
>
<p
class="mm-box mm-text mm-text--body-md-medium mm-box--color-inherit"
<div
class="mm-box mm-box--display-flex mm-box--align-items-center"
>
some label
</p>
<p
class="mm-box mm-text mm-text--body-md-medium mm-box--color-inherit"
>
some label
</p>
</div>
</div>
<p
class="mm-box mm-text mm-text--body-md mm-box--color-text-default"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@ exports[`AlertRow matches snapshot with no alert 1`] = `
>
<div
class="mm-box mm-box--display-flex mm-box--flex-direction-row mm-box--justify-content-center mm-box--align-items-flex-start mm-box--color-text-default"
style="align-items: center;"
>
<p
class="mm-box mm-text mm-text--body-md-medium mm-box--color-inherit"
<div
class="mm-box mm-box--display-flex mm-box--align-items-center"
>
Key
</p>
<p
class="mm-box mm-text mm-text--body-md-medium mm-box--color-inherit"
>
Key
</p>
</div>
</div>
<p
class="mm-box mm-text mm-text--body-md mm-box--color-text-default"
Expand Down
45 changes: 23 additions & 22 deletions ui/components/app/confirm/info/row/row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,29 +111,30 @@ export const ConfirmInfoRow: React.FC<ConfirmInfoRowProps> = ({
justifyContent={JustifyContent.center}
alignItems={AlignItems.flexStart}
color={color}
style={{ alignItems: AlignItems.center }}
>
<Text variant={TextVariant.bodyMdMedium} color={TextColor.inherit}>
{label}
</Text>
{labelChildren}
{tooltip && tooltip.length > 0 && (
<Tooltip
position="bottom"
title={tooltip}
style={{ display: 'flex' }}
>
<Icon
name={TOOLTIP_ICONS[variant]}
marginLeft={1}
color={TOOLTIP_ICON_COLORS[variant] as unknown as IconColor}
size={IconSize.Sm}
{...(dataTestId
? { 'data-testid': `${dataTestId}-tooltip` }
: {})}
/>
</Tooltip>
)}
<Box display={Display.Flex} alignItems={AlignItems.center}>
<Text variant={TextVariant.bodyMdMedium} color={TextColor.inherit}>
{label}
</Text>
{labelChildren}
{tooltip && tooltip.length > 0 && (
<Tooltip
position="bottom"
title={tooltip}
style={{ display: 'flex' }}
>
<Icon
name={TOOLTIP_ICONS[variant]}
marginLeft={1}
color={TOOLTIP_ICON_COLORS[variant] as unknown as IconColor}
size={IconSize.Sm}
{...(dataTestId
? { 'data-testid': `${dataTestId}-tooltip` }
: {})}
/>
</Tooltip>
)}
</Box>
</Box>
{typeof children === 'string' ? (
<Text marginRight={copyEnabled ? 3 : 0} color={TextColor.inherit}>
Expand Down
Loading

0 comments on commit 24811bb

Please sign in to comment.