mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
* refactor EntityTags component to work with metadata API format * hook for API metadata info query * make EntityTag component * make EntityTag component * display custom tag colors and sort tags by ordinal field * add tag popover * refactoring * display name tag in the lists * add mixpanel event and disable link for protocol and generic tags * adjust demo ENVs * tests * fix tests * change actionURL to tagUrl
10 lines
256 B
TypeScript
10 lines
256 B
TypeScript
export default function makePrettyLink(url: string | undefined): { url: string; domain: string } | undefined {
|
|
try {
|
|
const urlObj = new URL(url ?? '');
|
|
return {
|
|
url: urlObj.href,
|
|
domain: urlObj.hostname,
|
|
};
|
|
} catch (error) {}
|
|
}
|