parent
3354529114
commit
1315455b94
@ -107,13 +107,20 @@ function ProfileDmActions({ pubkey }: { pubkey: string }) {
|
|||||||
const profile = useUserProfile(System, pubkey);
|
const profile = useUserProfile(System, pubkey);
|
||||||
const { block, unblock, isBlocked } = useModeration();
|
const { block, unblock, isBlocked } = useModeration();
|
||||||
|
|
||||||
|
function truncAbout(s?: string) {
|
||||||
|
if ((s?.length ?? 0) > 200) {
|
||||||
|
return `${s?.slice(0, 200)}...`;
|
||||||
|
}
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
const blocked = isBlocked(pubkey);
|
const blocked = isBlocked(pubkey);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Avatar user={profile} size={210} />
|
<Avatar user={profile} size={210} />
|
||||||
<h2>{getDisplayName(profile, pubkey)}</h2>
|
<h2>{getDisplayName(profile, pubkey)}</h2>
|
||||||
<p>
|
<p>
|
||||||
<Text content={profile?.about ?? ""} tags={[]} creator={pubkey} disableMedia={true} depth={0} />
|
<Text content={truncAbout(profile?.about) ?? ""} tags={[]} creator={pubkey} disableMedia={true} depth={0} />
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div className="settings-row" onClick={() => (blocked ? unblock(pubkey) : block(pubkey))}>
|
<div className="settings-row" onClick={() => (blocked ? unblock(pubkey) : block(pubkey))}>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user