|
|
@ -37,7 +37,7 @@ const transformMetadata = (data: unknown): Profile | undefined => {
|
|
|
|
name,
|
|
|
|
name,
|
|
|
|
...(hasAboutString && {about: data.about as string}),
|
|
|
|
...(hasAboutString && {about: data.about as string}),
|
|
|
|
...(hasPictureString && {picture: data.picture as string}),
|
|
|
|
...(hasPictureString && {picture: data.picture as string}),
|
|
|
|
...(hasWebsite && {hasWebsite: data.website as string})
|
|
|
|
...(hasWebsite && {website: data.website as string})
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
@ -126,4 +126,15 @@ export const renderProfile = (pubkey: string) => {
|
|
|
|
detail?.append(...content);
|
|
|
|
detail?.append(...content);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (metadata.website) {
|
|
|
|
|
|
|
|
const website = detail.querySelector('[data-website]');
|
|
|
|
|
|
|
|
if (website) {
|
|
|
|
|
|
|
|
const url = metadata.website.toLowerCase().startsWith('http') ? metadata.website : `https://${metadata.website}`;
|
|
|
|
|
|
|
|
const [content] = parseTextContent(url);
|
|
|
|
|
|
|
|
website.replaceChildren(...content);
|
|
|
|
|
|
|
|
(website as HTMLDivElement).hidden = false;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
detail.append(elem('div', {data: {website: ''}}, metadata.name));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|