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: truncate account title #1579

Merged
merged 1 commit into from
Oct 16, 2022
Merged
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
11 changes: 7 additions & 4 deletions src/app/components/AccountMenu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function AccountMenu({ showOptions = true }: Props) {
const title =
!!authAccount?.name &&
typeof authAccount?.name === "string" &&
`${authAccount?.name} - ${authAccount?.alias}`.substring(0, 21);
`${authAccount?.name} - ${authAccount?.alias}`;

useEffect(() => {
getAccounts();
Expand Down Expand Up @@ -72,17 +72,20 @@ function AccountMenu({ showOptions = true }: Props) {
}

return (
<div className="relative pl-2 flex bg-gray-100 rounded-md dark:bg-surface-12dp">
<div className="relative pl-2 flex bg-gray-100 rounded-md dark:bg-surface-12dp max-w-full">
<p className="flex items-center">
<WalletIcon className="-ml-1 w-8 h-8 opacity-50 dark:text-white" />
</p>

<div
className={`flex-auto mx-2 py-1 ${
className={`flex-auto mx-2 py-1 overflow-hidden ${
!title && !balancesDecorated ? "w-28" : ""
}`}
>
<p className="text-xs text-gray-700 dark:text-neutral-400">
<p
title={title || ""}
className="text-xs text-gray-700 dark:text-neutral-400 text-ellipsis overflow-hidden whitespace-nowrap"
>
{title || <Skeleton />}
</p>

Expand Down