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