-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Better handle very long names in the name component #28560
Conversation
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
ui/components/app/name/name.tsx
Outdated
@@ -60,6 +60,20 @@ function formatValue(value: string, type: NameType): string { | |||
} | |||
} | |||
|
|||
export function formatName(name: string): string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shortenString
from ui/helpers/utils/util.js
?
Builds ready [b50e87b]
Page Load Metrics (2353 ± 91 ms)
Bundle size diffs
|
@@ -135,7 +141,7 @@ const Name = memo( | |||
)} | |||
{hasDisplayName ? ( | |||
<Text className="name__name" variant={TextVariant.bodyMd}> | |||
{name} | |||
{formattedName} | |||
</Text> | |||
) : ( | |||
<Text className="name__value" variant={TextVariant.bodyMd}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will be nice to have some unit test coverage also
b50e87b
to
a5b411b
Compare
Builds ready [a5b411b]
Page Load Metrics (2252 ± 128 ms)
Bundle size diffs
|
Description
Truncates long names (>15 characters).
Related issues
Fixes: https://github.com/MetaMask/MetaMask-planning/issues/3630
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist