Add user addresses to profile page, hide details by default
This commit is contained in:
parent
2624f2cbf8
commit
a6517c61a4
@ -113,6 +113,11 @@ main.profile-page img.avatar {
|
|||||||
width: 8rem;
|
width: 8rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
main.profile-page details summary {
|
||||||
|
cursor: pointer;
|
||||||
|
margin-bottom: 1.6rem;
|
||||||
|
}
|
||||||
|
|
||||||
main .article-list .item h3 {
|
main .article-list .item h3 {
|
||||||
margin-bottom: 0.5rem;
|
margin-bottom: 0.5rem;
|
||||||
}
|
}
|
||||||
|
19
html.ts
19
html.ts
@ -107,6 +107,19 @@ export function articleListHtml(articles: Article[]): string {
|
|||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function userAddressHtml(profile: Profile) {
|
||||||
|
let html = "";
|
||||||
|
|
||||||
|
if (profile.nip05) {
|
||||||
|
html += `<dt>Nostr address</dt><dd>${profile.nip05}</dd>\n`;
|
||||||
|
}
|
||||||
|
if (profile.lud16) {
|
||||||
|
html += `<dt>Lightning address</dt><dd>${profile.lud16}</dd>\n`;
|
||||||
|
}
|
||||||
|
|
||||||
|
return html;
|
||||||
|
}
|
||||||
|
|
||||||
export function profilePageHtml(profile: Profile, articles: Article[]): string {
|
export function profilePageHtml(profile: Profile, articles: Article[]): string {
|
||||||
const title = `${profile.name} on Nostr`;
|
const title = `${profile.name} on Nostr`;
|
||||||
|
|
||||||
@ -121,12 +134,14 @@ export function profilePageHtml(profile: Profile, articles: Article[]): string {
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
<section>
|
<details>
|
||||||
|
<summary>Details</summary>
|
||||||
<dl>
|
<dl>
|
||||||
<dt>Public key</dt>
|
<dt>Public key</dt>
|
||||||
<dd>${profile.npub}</dd>
|
<dd>${profile.npub}</dd>
|
||||||
|
${userAddressHtml(profile)}
|
||||||
</dl>
|
</dl>
|
||||||
</section>
|
</details>
|
||||||
<section>
|
<section>
|
||||||
${articleListHtml(articles)}
|
${articleListHtml(articles)}
|
||||||
</section>
|
</section>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user