Skip to content

Commit

Permalink
fix: Fix icon alignment in signature pages message section (#29284)
Browse files Browse the repository at this point in the history
## **Description**

Fix icon alignment in signature pages message section.

## **Related issues**

Fixes: #28793

## **Manual testing steps**

1. Go to test dapp
2. Submit permit
3. Check expand and copy icons position in message section

## **Screenshots/Recordings**
<img width="360" alt="Screenshot 2024-12-17 at 9 06 53 PM"
src="https://github.com/user-attachments/assets/48961c2a-b5c6-4b38-b005-0accb4ff3f3d"
/>

## **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.
  • Loading branch information
jpuri authored Dec 18, 2024
1 parent 26f7c5a commit b018c81
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ exports[`ConfirmInfoRow should match snapshot when copy is enabled 1`] = `
<button
aria-label="copy-button"
class="mm-box mm-button-icon mm-button-icon--size-sm mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-icon-muted mm-box--background-color-transparent mm-box--rounded-lg"
style="cursor: pointer; position: absolute; right: 4px; top: 4px;"
style="cursor: pointer; position: absolute; right: 4px; top: 2px;"
>
<span
class="mm-box mm-icon mm-icon--size-sm mm-box--display-inline-block mm-box--color-inherit"
Expand Down
3 changes: 1 addition & 2 deletions ui/components/app/confirm/info/row/row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export const ConfirmInfoRow: React.FC<ConfirmInfoRowProps> = ({
{copyEnabled && (
<CopyIcon
copyText={copyText ?? ''}
style={{ right: isCollapsible ? 32 : 4, top: 4 }}
style={{ right: isCollapsible ? 32 : 4 }}
color={IconColor.iconMuted}
/>
)}
Expand All @@ -130,7 +130,6 @@ export const ConfirmInfoRow: React.FC<ConfirmInfoRowProps> = ({
cursor: 'pointer',
position: 'absolute',
right: 8,
top: 4,
}}
onClick={() => setExpanded(!expanded)}
data-testid="sectionCollapseButton"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ exports[`Info renders info section for personal sign request 1`] = `
<button
aria-label="copy-button"
class="mm-box mm-button-icon mm-button-icon--size-sm mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-icon-muted mm-box--background-color-transparent mm-box--rounded-lg"
style="cursor: pointer; position: absolute; right: 32px; top: 4px;"
style="cursor: pointer; position: absolute; right: 32px; top: 2px;"
>
<span
class="mm-box mm-icon mm-icon--size-sm mm-box--display-inline-block mm-box--color-inherit"
Expand All @@ -581,7 +581,7 @@ exports[`Info renders info section for personal sign request 1`] = `
aria-label="collapse-button"
class="mm-box mm-button-icon mm-button-icon--size-sm mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-icon-muted mm-box--background-color-transparent mm-box--rounded-lg"
data-testid="sectionCollapseButton"
style="cursor: pointer; position: absolute; right: 8px; top: 4px;"
style="cursor: pointer; position: absolute; right: 8px;"
>
<span
class="mm-box mm-icon mm-icon--size-sm mm-box--display-inline-block mm-box--color-inherit"
Expand Down Expand Up @@ -1019,7 +1019,7 @@ exports[`Info renders info section for typed sign request 1`] = `
<button
aria-label="copy-button"
class="mm-box mm-button-icon mm-button-icon--size-sm mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-icon-muted mm-box--background-color-transparent mm-box--rounded-lg"
style="cursor: pointer; position: absolute; right: 4px; top: 4px;"
style="cursor: pointer; position: absolute; right: 4px; top: 2px;"
>
<span
class="mm-box mm-icon mm-icon--size-sm mm-box--display-inline-block mm-box--color-inherit"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ exports[`<ApproveInfo /> renders component for approve request 1`] = `
<button
aria-label="copy-button"
class="mm-box mm-button-icon mm-button-icon--size-sm mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-icon-muted mm-box--background-color-transparent mm-box--rounded-lg"
style="cursor: pointer; position: absolute; right: 4px; top: 4px;"
style="cursor: pointer; position: absolute; right: 4px; top: 2px;"
>
<span
class="mm-box mm-icon mm-icon--size-sm mm-box--display-inline-block mm-box--color-inherit"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ exports[`PersonalSignInfo handle reverse string properly 1`] = `
<button
aria-label="copy-button"
class="mm-box mm-button-icon mm-button-icon--size-sm mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-icon-muted mm-box--background-color-transparent mm-box--rounded-lg"
style="cursor: pointer; position: absolute; right: 32px; top: 4px;"
style="cursor: pointer; position: absolute; right: 32px; top: 2px;"
>
<span
class="mm-box mm-icon mm-icon--size-sm mm-box--display-inline-block mm-box--color-inherit"
Expand All @@ -69,7 +69,7 @@ exports[`PersonalSignInfo handle reverse string properly 1`] = `
aria-label="collapse-button"
class="mm-box mm-button-icon mm-button-icon--size-sm mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-icon-muted mm-box--background-color-transparent mm-box--rounded-lg"
data-testid="sectionCollapseButton"
style="cursor: pointer; position: absolute; right: 8px; top: 4px;"
style="cursor: pointer; position: absolute; right: 8px;"
>
<span
class="mm-box mm-icon mm-icon--size-sm mm-box--display-inline-block mm-box--color-inherit"
Expand Down Expand Up @@ -162,7 +162,7 @@ exports[`PersonalSignInfo renders correctly for personal sign request 1`] = `
<button
aria-label="copy-button"
class="mm-box mm-button-icon mm-button-icon--size-sm mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-icon-muted mm-box--background-color-transparent mm-box--rounded-lg"
style="cursor: pointer; position: absolute; right: 32px; top: 4px;"
style="cursor: pointer; position: absolute; right: 32px; top: 2px;"
>
<span
class="mm-box mm-icon mm-icon--size-sm mm-box--display-inline-block mm-box--color-inherit"
Expand All @@ -173,7 +173,7 @@ exports[`PersonalSignInfo renders correctly for personal sign request 1`] = `
aria-label="collapse-button"
class="mm-box mm-button-icon mm-button-icon--size-sm mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-icon-muted mm-box--background-color-transparent mm-box--rounded-lg"
data-testid="sectionCollapseButton"
style="cursor: pointer; position: absolute; right: 8px; top: 4px;"
style="cursor: pointer; position: absolute; right: 8px;"
>
<span
class="mm-box mm-icon mm-icon--size-sm mm-box--display-inline-block mm-box--color-inherit"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ exports[`SIWESignInfo renders correctly for SIWE signature request 1`] = `
<button
aria-label="copy-button"
class="mm-box mm-button-icon mm-button-icon--size-sm mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-icon-muted mm-box--background-color-transparent mm-box--rounded-lg"
style="cursor: pointer; position: absolute; right: 32px; top: 4px;"
style="cursor: pointer; position: absolute; right: 32px; top: 2px;"
>
<span
class="mm-box mm-icon mm-icon--size-sm mm-box--display-inline-block mm-box--color-inherit"
Expand All @@ -20,7 +20,7 @@ exports[`SIWESignInfo renders correctly for SIWE signature request 1`] = `
aria-label="collapse-button"
class="mm-box mm-button-icon mm-button-icon--size-sm mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-icon-muted mm-box--background-color-transparent mm-box--rounded-lg"
data-testid="sectionCollapseButton"
style="cursor: pointer; position: absolute; right: 8px; top: 4px;"
style="cursor: pointer; position: absolute; right: 8px;"
>
<span
class="mm-box mm-icon mm-icon--size-sm mm-box--display-inline-block mm-box--color-inherit"
Expand Down Expand Up @@ -53,7 +53,7 @@ exports[`SIWESignInfo renders correctly for SIWE signature request with resource
<button
aria-label="copy-button"
class="mm-box mm-button-icon mm-button-icon--size-sm mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-icon-muted mm-box--background-color-transparent mm-box--rounded-lg"
style="cursor: pointer; position: absolute; right: 32px; top: 4px;"
style="cursor: pointer; position: absolute; right: 32px; top: 2px;"
>
<span
class="mm-box mm-icon mm-icon--size-sm mm-box--display-inline-block mm-box--color-inherit"
Expand All @@ -64,7 +64,7 @@ exports[`SIWESignInfo renders correctly for SIWE signature request with resource
aria-label="collapse-button"
class="mm-box mm-button-icon mm-button-icon--size-sm mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-icon-muted mm-box--background-color-transparent mm-box--rounded-lg"
data-testid="sectionCollapseButton"
style="cursor: pointer; position: absolute; right: 8px; top: 4px;"
style="cursor: pointer; position: absolute; right: 8px;"
>
<span
class="mm-box mm-icon mm-icon--size-sm mm-box--display-inline-block mm-box--color-inherit"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ exports[`TransactionData renders decoded data with names and descriptions 1`] =
<button
aria-label="copy-button"
class="mm-box mm-button-icon mm-button-icon--size-sm mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-icon-muted mm-box--background-color-transparent mm-box--rounded-lg"
style="cursor: pointer; position: absolute; right: 4px; top: 4px;"
style="cursor: pointer; position: absolute; right: 4px; top: 2px;"
>
<span
class="mm-box mm-icon mm-icon--size-sm mm-box--display-inline-block mm-box--color-inherit"
Expand Down Expand Up @@ -1024,7 +1024,7 @@ exports[`TransactionData renders decoded data with no names 1`] = `
<button
aria-label="copy-button"
class="mm-box mm-button-icon mm-button-icon--size-sm mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-icon-muted mm-box--background-color-transparent mm-box--rounded-lg"
style="cursor: pointer; position: absolute; right: 4px; top: 4px;"
style="cursor: pointer; position: absolute; right: 4px; top: 2px;"
>
<span
class="mm-box mm-icon mm-icon--size-sm mm-box--display-inline-block mm-box--color-inherit"
Expand Down Expand Up @@ -1246,7 +1246,7 @@ exports[`TransactionData renders decoded data with tuples and arrays 1`] = `
<button
aria-label="copy-button"
class="mm-box mm-button-icon mm-button-icon--size-sm mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-icon-muted mm-box--background-color-transparent mm-box--rounded-lg"
style="cursor: pointer; position: absolute; right: 4px; top: 4px;"
style="cursor: pointer; position: absolute; right: 4px; top: 2px;"
>
<span
class="mm-box mm-icon mm-icon--size-sm mm-box--display-inline-block mm-box--color-inherit"
Expand Down Expand Up @@ -2314,7 +2314,7 @@ exports[`TransactionData renders raw hexadecimal if no decoded data 1`] = `
<button
aria-label="copy-button"
class="mm-box mm-button-icon mm-button-icon--size-sm mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-icon-muted mm-box--background-color-transparent mm-box--rounded-lg"
style="cursor: pointer; position: absolute; right: 4px; top: 4px;"
style="cursor: pointer; position: absolute; right: 4px; top: 2px;"
>
<span
class="mm-box mm-icon mm-icon--size-sm mm-box--display-inline-block mm-box--color-inherit"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ exports[`TypedSignInfo correctly renders typed sign data request 1`] = `
<button
aria-label="copy-button"
class="mm-box mm-button-icon mm-button-icon--size-sm mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-icon-muted mm-box--background-color-transparent mm-box--rounded-lg"
style="cursor: pointer; position: absolute; right: 32px; top: 4px;"
style="cursor: pointer; position: absolute; right: 32px; top: 2px;"
>
<span
class="mm-box mm-icon mm-icon--size-sm mm-box--display-inline-block mm-box--color-inherit"
Expand All @@ -69,7 +69,7 @@ exports[`TypedSignInfo correctly renders typed sign data request 1`] = `
aria-label="collapse-button"
class="mm-box mm-button-icon mm-button-icon--size-sm mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-icon-muted mm-box--background-color-transparent mm-box--rounded-lg"
data-testid="sectionCollapseButton"
style="cursor: pointer; position: absolute; right: 8px; top: 4px;"
style="cursor: pointer; position: absolute; right: 8px;"
>
<span
class="mm-box mm-icon mm-icon--size-sm mm-box--display-inline-block mm-box--color-inherit"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ exports[`TypedSignInfo correctly renders permit sign type 1`] = `
<button
aria-label="copy-button"
class="mm-box mm-button-icon mm-button-icon--size-sm mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-icon-muted mm-box--background-color-transparent mm-box--rounded-lg"
style="cursor: pointer; position: absolute; right: 32px; top: 4px;"
style="cursor: pointer; position: absolute; right: 32px; top: 2px;"
>
<span
class="mm-box mm-icon mm-icon--size-sm mm-box--display-inline-block mm-box--color-inherit"
Expand All @@ -350,7 +350,7 @@ exports[`TypedSignInfo correctly renders permit sign type 1`] = `
aria-label="collapse-button"
class="mm-box mm-button-icon mm-button-icon--size-sm mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-icon-muted mm-box--background-color-transparent mm-box--rounded-lg"
data-testid="sectionCollapseButton"
style="cursor: pointer; position: absolute; right: 8px; top: 4px;"
style="cursor: pointer; position: absolute; right: 8px;"
>
<span
class="mm-box mm-icon mm-icon--size-sm mm-box--display-inline-block mm-box--color-inherit"
Expand Down Expand Up @@ -714,7 +714,7 @@ exports[`TypedSignInfo correctly renders permit sign type with no deadline 1`] =
<button
aria-label="copy-button"
class="mm-box mm-button-icon mm-button-icon--size-sm mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-icon-muted mm-box--background-color-transparent mm-box--rounded-lg"
style="cursor: pointer; position: absolute; right: 32px; top: 4px;"
style="cursor: pointer; position: absolute; right: 32px; top: 2px;"
>
<span
class="mm-box mm-icon mm-icon--size-sm mm-box--display-inline-block mm-box--color-inherit"
Expand All @@ -725,7 +725,7 @@ exports[`TypedSignInfo correctly renders permit sign type with no deadline 1`] =
aria-label="collapse-button"
class="mm-box mm-button-icon mm-button-icon--size-sm mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-icon-muted mm-box--background-color-transparent mm-box--rounded-lg"
data-testid="sectionCollapseButton"
style="cursor: pointer; position: absolute; right: 8px; top: 4px;"
style="cursor: pointer; position: absolute; right: 8px;"
>
<span
class="mm-box mm-icon mm-icon--size-sm mm-box--display-inline-block mm-box--color-inherit"
Expand Down Expand Up @@ -888,7 +888,7 @@ exports[`TypedSignInfo renders origin for typed sign data request 1`] = `
<button
aria-label="copy-button"
class="mm-box mm-button-icon mm-button-icon--size-sm mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-icon-muted mm-box--background-color-transparent mm-box--rounded-lg"
style="cursor: pointer; position: absolute; right: 4px; top: 4px;"
style="cursor: pointer; position: absolute; right: 4px; top: 2px;"
>
<span
class="mm-box mm-icon mm-icon--size-sm mm-box--display-inline-block mm-box--color-inherit"
Expand Down Expand Up @@ -1754,7 +1754,7 @@ exports[`TypedSignInfo should render message for typed sign v3 request 1`] = `
<button
aria-label="copy-button"
class="mm-box mm-button-icon mm-button-icon--size-sm mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-icon-muted mm-box--background-color-transparent mm-box--rounded-lg"
style="cursor: pointer; position: absolute; right: 4px; top: 4px;"
style="cursor: pointer; position: absolute; right: 4px; top: 2px;"
>
<span
class="mm-box mm-icon mm-icon--size-sm mm-box--display-inline-block mm-box--color-inherit"
Expand Down Expand Up @@ -2243,7 +2243,7 @@ exports[`TypedSignInfo should render message for typed sign v4 request 1`] = `
<button
aria-label="copy-button"
class="mm-box mm-button-icon mm-button-icon--size-sm mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-icon-muted mm-box--background-color-transparent mm-box--rounded-lg"
style="cursor: pointer; position: absolute; right: 4px; top: 4px;"
style="cursor: pointer; position: absolute; right: 4px; top: 2px;"
>
<span
class="mm-box mm-icon mm-icon--size-sm mm-box--display-inline-block mm-box--color-inherit"
Expand Down
Loading

0 comments on commit b018c81

Please sign in to comment.