forked from Kieran/zap.stream
fix: don't render link for anon profiles
This commit is contained in:
parent
cbc49a0def
commit
3224b03a98
@ -146,7 +146,7 @@ function ChatZap({ ev }: { ev: TaggedRawEvent }) {
|
||||
<div className="zap">
|
||||
<Icon name="zap-filled" className="zap-icon" />
|
||||
<Profile
|
||||
pubkey={parsed.anonZap ? "" : parsed.sender ?? ""}
|
||||
pubkey={parsed.anonZap ? "anon" : parsed.sender ?? "anon"}
|
||||
options={{
|
||||
showAvatar: !parsed.anonZap,
|
||||
overrideName: parsed.anonZap ? "Anon" : undefined,
|
||||
|
@ -35,19 +35,22 @@ export function Profile({
|
||||
options?: ProfileOptions;
|
||||
}) {
|
||||
const profile = useUserProfile(System, pubkey);
|
||||
const showAvatar = options?.showAvatar ?? true;
|
||||
const showName = options?.showName ?? true;
|
||||
|
||||
const content = (
|
||||
<>
|
||||
{(options?.showAvatar ?? true) && pubkey === "anon" ? (
|
||||
<Icon size={40} name="zap-filled" />
|
||||
) : (
|
||||
<img
|
||||
alt={profile?.name || pubkey}
|
||||
className={avatarClassname ? avatarClassname : ""}
|
||||
src={profile?.picture ?? ""}
|
||||
/>
|
||||
)}
|
||||
{(options?.showName ?? true) && (
|
||||
{showAvatar &&
|
||||
(pubkey === "anon" ? (
|
||||
<Icon size={40} name="zap-filled" />
|
||||
) : (
|
||||
<img
|
||||
alt={profile?.name || pubkey}
|
||||
className={avatarClassname ? avatarClassname : ""}
|
||||
src={profile?.picture ?? ""}
|
||||
/>
|
||||
))}
|
||||
{showName && (
|
||||
<span>
|
||||
{options?.overrideName ?? pubkey === "anon"
|
||||
? "Anon"
|
||||
|
Loading…
Reference in New Issue
Block a user