Skip to content

Commit 1bff55c

Browse files
author
lukaw3d
committed
Revert "Replace TruncatedAddress with displayName (truncated by rainbowkit)"
This reverts commit 9e5efe8.
1 parent cc4a99c commit 1bff55c

File tree

1 file changed

+13
-3
lines changed
  • src/components/RainbowKitConnectButton

1 file changed

+13
-3
lines changed

src/components/RainbowKitConnectButton/index.tsx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@ import { useNavigate } from 'react-router-dom'
1616
import { useRoflAppBackendAuthContext } from '../../contexts/RoflAppBackendAuth/hooks'
1717
import { ENABLED_CHAINS_IDS } from '../../constants/top-up-config.ts'
1818

19+
const TruncatedAddress: FC<{ address: string; className?: string }> = ({ address, className = '' }) => {
20+
return (
21+
<div className={`flex overflow-hidden ${className}`}>
22+
<span className="flex-1 truncate min-w-0">{address.slice(0, -4)}</span>
23+
<span className="flex-shrink-0">{address.slice(-4)}</span>
24+
</div>
25+
)
26+
}
27+
1928
interface Props {
2029
onMobileClose?: () => void
2130
}
@@ -124,9 +133,10 @@ export const RainbowKitConnectButton: FC<Props> = ({ onMobileClose }) => {
124133
}}
125134
/>
126135
<div className="flex flex-col items-start min-w-0 flex-1">
127-
<span className="mono text-foreground text-base font-medium leading-6 w-full">
128-
{account.displayName}
129-
</span>
136+
<TruncatedAddress
137+
address={address as `0x${string}`}
138+
className="mono text-foreground text-base font-medium leading-6 w-full"
139+
/>
130140
<p className="text-muted-foreground text-sm leading-5">{account.displayBalance}</p>
131141
</div>
132142
</button>

0 commit comments

Comments
 (0)