snowballtools-base/packages/frontend/src/utils/format.ts
Nabarun Gogoi 353fd0f621
Set authority for record name from backend config (#104)
* Fix format of eth address to display

* Set authority for record name from backend config

* Add functionality to open repo button

* Use commit author image and commit url in activity card

* Handle review changes

* Fix commit author as null

* Add timeout to move to next page on project creation

---------

Co-authored-by: neeraj <neeraj.rtly@gmail.com>
2024-02-23 14:47:29 +05:30

8 lines
194 B
TypeScript

export const formatAddress = (address: string) => {
if (address.startsWith('0x') && address.length > 10) {
return address.slice(0, 6) + '..' + address.slice(-4);
}
return address;
};