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:
Alexis Sellier
2021-09-16 14:31:54 +02:00
parent 6fcac9cffe
commit 3a5ee3f3d6
3 changed files with 10 additions and 6 deletions
+1 -1
View File
@@ -70,7 +70,7 @@
justify-content: center;
min-height: 42px;
margin-left: 2rem;
width: 9.25rem;
width: 10rem;
}
.connect {
display: inline-block;
+3 -3
View File
@@ -15,8 +15,8 @@
<style>
.org {
width: 7rem;
height: 7rem;
width: 8rem;
height: 8rem;
margin-left: 3rem;
margin-top: 1.5rem;
margin-bottom: 1.5rem;
@@ -41,7 +41,7 @@
padding: 0rem 0.5rem;
text-overflow: ellipsis;
overflow-x: hidden;
max-width: 7rem;
max-width: 8rem;
}
.list {
display: flex;
+6 -2
View File
@@ -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 {