-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(snaps): Adjust alignment of custom UI links (#27957)
## **Description** This PR fixes the alignment issues of the custom UI link. [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/27957?quickstart=1) ## **Related issues** Fixes: ## **Manual testing steps** ```ts import { Address, Box, Button, Container, Footer, Link, Row, Text, type SnapComponent, } from '@metamask/snaps-sdk/jsx'; /** * A custom dialog component. * * @returns The custom dialog component. */ export const CustomDialog: SnapComponent = () => ( <Container> <Box> <Row label="Test"> <Link href="https://metamask.io"> <Address address="0xc366063eA70eBD30316062C9C82445591c772870" /> </Link> </Row> <Link href="https://metamask.io">This is a link</Link> <Text> This is a long text that should wrap around and take up multiple lines to test the layout of the dialog with a{' '} <Link href="https://metamask.io"> very very very very long link that should wrap on multiple lines, we will see </Link>{' '} in the middle. </Text> <Link href="https://metamask.io"> <Icon name="search" /> </Link> <Link href="https://metamask.io"> <Address address="0xc366063eA70eBD30316062C9C82445591c772870" /> </Link> </Box> <Footer> <Button name="cancel">Cancel</Button> <Button name="confirm">Confirm</Button> </Footer> </Container> ); ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** ![Screenshot from 2024-10-21 12-34-40](https://github.com/user-attachments/assets/3838dafa-8143-4b3d-bb28-699ce139e7da) ### **After** ![Screenshot from 2024-10-21 15-06-57](https://github.com/user-attachments/assets/f789dc89-3550-416f-8ada-dcb86f01c151) ## **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/develop/.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/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
1 parent
134d9a6
commit d8f786b
Showing
6 changed files
with
44 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.snap-ui-renderer__link { | ||
& .snap-ui-renderer__address { | ||
// Fixes an issue where the link end icon would wrap | ||
display: inline-flex; | ||
} | ||
|
||
.snap-ui-renderer__address + .mm-icon { | ||
// This fixes an issue where the icon would be misaligned with the Address component | ||
top: 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters