File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
src/components/RainbowKitConnectButton Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,15 @@ import { useNavigate } from 'react-router-dom'
1616import { useRoflAppBackendAuthContext } from '../../contexts/RoflAppBackendAuth/hooks'
1717import { 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+
1928interface 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 >
You can’t perform that action at this time.
0 commit comments