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: [lw-11846]: shorted wallet name and account in the user dropdown #1538

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ export const DropdownMenu = ({ isPopup }: DropdownMenuProps): React.ReactElement
<div className={styles.profileDropdownTrigger}>
<ProfileDropdown.Trigger
title={addEllipsis(walletName, titleCharBeforeEll, titleCharAfterEll)}
subtitle={getActiveWalletSubtitle(cardanoWallet?.source.account)}
subtitle={addEllipsis(
getActiveWalletSubtitle(cardanoWallet?.source.account),
titleCharBeforeEll,
titleCharAfterEll
)}
active={isDropdownMenuOpen}
profile={
activeWalletAvatar
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-console */
import React, { useCallback } from 'react';
import classnames from 'classnames';
import { useWalletStore } from '@src/stores';
Expand All @@ -20,6 +21,7 @@ import { getUiWalletType } from '@src/utils/get-ui-wallet-type';
const ADRESS_FIRST_PART_LENGTH = 10;
const ADRESS_LAST_PART_LENGTH = 5;
const WALLET_NAME_MAX_LENGTH = 16;
const WALLET_OPTION_NAME_MAX_LENGTH = 12;
const TOAST_DEFAULT_DURATION = 3;

const overlayInnerStyle = {
Expand Down Expand Up @@ -91,8 +93,12 @@ export const UserInfo = ({ onOpenWalletAccounts, avatarVisible = true }: UserInf
return (
<ProfileDropdown.WalletOption
key={wallet.walletId}
title={wallet.metadata.name}
subtitle={lastActiveAccount?.metadata.name || t('sharedWallets.userInfo.label')}
title={addEllipsis(wallet.metadata.name, WALLET_OPTION_NAME_MAX_LENGTH, 0)}
subtitle={addEllipsis(
lastActiveAccount?.metadata.name || t('sharedWallets.userInfo.label'),
WALLET_OPTION_NAME_MAX_LENGTH,
0
)}
id={`wallet-option-${wallet.walletId}`}
onClick={async () => {
if (activeWalletId === wallet.walletId) {
Expand Down
Loading