mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-21 14:20:42 +08:00
Display short addresses differently
Use an "en dash" instead of an ellipsis. Signed-off-by: Alexis Sellier <self@cloudhead.io>
This commit is contained in:
+6
-2
@@ -48,8 +48,12 @@ export function formatCAIP10Address(address: string, protocol: string, impl: num
|
||||
return `${address.toLowerCase()}@${protocol}:${impl.toString()}`;
|
||||
}
|
||||
|
||||
export function formatAddress(addr: string): string {
|
||||
return formatHash(ethers.utils.getAddress(addr)).replace(/^0x/, "");
|
||||
export function formatAddress(input: string): string {
|
||||
const addr = ethers.utils.getAddress(input).replace(/^0x/, "");
|
||||
|
||||
return addr.substring(0, 4)
|
||||
+ ' – '
|
||||
+ addr.substring(addr.length - 4, addr.length);
|
||||
}
|
||||
|
||||
export function formatIpfsFile(ipfs: string | undefined): string | undefined {
|
||||
|
||||
Reference in New Issue
Block a user