Skip to content
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

fix: Reduce max pet name length #28660

Merged
merged 1 commit into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ui/components/app/name/__snapshots__/name.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ exports[`Name renders address with long saved name 1`] = `
<p
class="mm-box mm-text name__name mm-text--body-md mm-box--color-text-default"
>
Very long and l...
Very long an...
</p>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ exports[`NameDetails renders with recognized name 1`] = `
<p
class="mm-box mm-text name__name mm-text--body-md mm-box--color-text-default"
>
iZUMi Bond USD
iZUMi Bond U...
</p>
</div>
</div>
Expand Down
5 changes: 3 additions & 2 deletions ui/components/app/name/name.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,10 @@ const Name = memo(
}, [setModalOpen]);

const formattedValue = formatValue(value, type);
const MAX_PET_NAME_LENGTH = 12;
const formattedName = shortenString(name || undefined, {
truncatedCharLimit: 15,
truncatedStartChars: 15,
truncatedCharLimit: MAX_PET_NAME_LENGTH,
truncatedStartChars: MAX_PET_NAME_LENGTH,
truncatedEndChars: 0,
skipCharacterInEnd: true,
});
Expand Down
Loading