-
Notifications
You must be signed in to change notification settings - Fork 5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing truncation and alignment in the network toggle component (#21370)
## **Description** Currently there is some truncation issues with long network names in the privacy incoming transactions section. The truncation of the text is not working which results in broken UI for longer network names This PR adds some styles which resolve the issue as well as adding a story for the network-toggle component for easier revision and review ## **Manual testing steps** _1. Open the storybook build on this PR _2. Search `NetworkToggle` and check the story in small screen sizes _3. Pull this branch _4. Go to Settings > Security & privacy > Incoming transactions section ## **Screenshots/Recordings** ### **Before** https://github.com/MetaMask/metamask-extension/assets/8112138/9a7028ca-f70a-4833-94db-75e81b791206 ### **After** https://github.com/MetaMask/metamask-extension/assets/8112138/770cb8c7-f8ba-4a40-b941-1115bcbdd83c ## **Related issues** _Fixes #21369_ ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [x] I've clearly explained: - [x] What problem this PR is solving. - [x] How this problem was solved. - [x] How reviewers can test my changes. - [x] I’ve indicated what issue this PR is linked to: Fixes #21369 - [x] I’ve included tests if applicable. - [x] I’ve documented any added code. - [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)). - [x] I’ve properly set the pull request status: - [x] In case it's not yet "ready for review", I've set it to "draft". - [x] In case it's "ready for review", I've changed it from "draft" to "non-draft". ## **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
8235fa2
commit b0c0c35
Showing
6 changed files
with
549 additions
and
453 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
492 changes: 258 additions & 234 deletions
492
...nts/app/incoming-trasaction-toggle/__snapshots__/incoming-transaction-toggle.test.js.snap
Large diffs are not rendered by default.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
ui/components/app/incoming-trasaction-toggle/network-toggle.scss
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,5 @@ | ||
.network-toggle-wrapper { | ||
&__overflow-container { | ||
overflow: hidden; | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
ui/components/app/incoming-trasaction-toggle/network-toggle.stories.tsx
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,33 @@ | ||
import React from 'react'; | ||
import { StoryFn, Meta } from '@storybook/react'; | ||
import NetworkToggle from './network-toggle'; | ||
|
||
export default { | ||
title: 'Components/App/IncomingTransactionToggle/NetworkToggle', | ||
component: NetworkToggle, | ||
argTypes: { | ||
chainId: { | ||
control: 'text', | ||
}, | ||
networkPreferences: { | ||
control: 'object', | ||
}, | ||
toggleSingleNetwork: { | ||
action: 'toggleSingleNetwork', | ||
}, | ||
}, | ||
args: { | ||
networkPreferences: { | ||
isShowIncomingTransactions: true, | ||
label: 'Ethereum or long network name', | ||
imageUrl: './images/ethereum.svg', | ||
}, | ||
chainId: '0x1', | ||
}, | ||
} as Meta<typeof NetworkToggle>; | ||
|
||
export const DefaultStory: StoryFn<typeof NetworkToggle> = (args) => ( | ||
<NetworkToggle {...args} /> | ||
); | ||
|
||
DefaultStory.storyName = 'Default'; |
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
Oops, something went wrong.