display name and nip05

This commit is contained in:
Alejandro Gomez 2023-01-15 13:46:35 +01:00
parent 02af127869
commit 75badd2845
No known key found for this signature in database
GPG Key ID: 4DF39E566658C817
2 changed files with 16 additions and 11 deletions

View File

@ -17,14 +17,18 @@
.pfp a:hover {
text-decoration: underline;
text-decoration-color: var(--gray-superlight);
}
.pfp .profile-name {
display: flex;
flex-direction: column;
font-weight: bold;
margin-bottom: .2em;
}
.pfp .nip05 {
font-size: 16px;
margin: 0;
}
.pfp .profile-name {
display: flex;
flex-direction: row;
margin-top: -.2em;
}

View File

@ -27,17 +27,18 @@ export default function ProfileImage({ pubkey, subHeader, showUsername = true, c
<div className={`pfp ${className}`}>
<LazyImage src={hasImage ? user.picture : Nostrich} onClick={() => navigate(link ?? profileLink(pubkey))} />
{showUsername && (<div className="f-grow">
<div className="profile-name">
<Link key={pubkey} to={link ?? profileLink(pubkey)}>
{user?.nip05 ? (
<Link key={pubkey} to={link ?? profileLink(pubkey)}>
<div className="profile-name">
<div>{name}</div>
{user?.nip05 && (
<Nip05
nip05={user.nip05}
pubkey={user.pubkey}
defaultUsername={user.display_name || user.name}
/>
): name}
</Link>
</div>
)}
</div>
</Link>
{subHeader ? <>{subHeader}</> : null}
</div>
)}