forked from Kieran/snort
no avatar title when profilecard is shown
This commit is contained in:
parent
51e68b1288
commit
d84843a46d
@ -16,10 +16,21 @@ interface AvatarProps {
|
||||
image?: string;
|
||||
imageOverlay?: ReactNode;
|
||||
icons?: ReactNode;
|
||||
showTitle?: boolean;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
const Avatar = ({ pubkey, user, size, onClick, image, imageOverlay, icons, className }: AvatarProps) => {
|
||||
const Avatar = ({
|
||||
pubkey,
|
||||
user,
|
||||
size,
|
||||
onClick,
|
||||
image,
|
||||
imageOverlay,
|
||||
icons,
|
||||
className,
|
||||
showTitle = true,
|
||||
}: AvatarProps) => {
|
||||
const [url, setUrl] = useState("");
|
||||
|
||||
useEffect(() => {
|
||||
@ -44,7 +55,7 @@ const Avatar = ({ pubkey, user, size, onClick, image, imageOverlay, icons, class
|
||||
className,
|
||||
)}
|
||||
data-domain={domain?.toLowerCase()}
|
||||
title={getDisplayName(user, "")}>
|
||||
title={showTitle ? getDisplayName(user, "") : undefined}>
|
||||
<ProxyImg
|
||||
className="rounded-full object-cover aspect-square"
|
||||
src={url}
|
||||
|
@ -47,7 +47,7 @@ export default function ProfileImage({
|
||||
onClick,
|
||||
showFollowDistance = true,
|
||||
icons,
|
||||
showProfileCard,
|
||||
showProfileCard = true,
|
||||
}: ProfileImageProps) {
|
||||
const user = useUserProfile(profile ? "" : pubkey) ?? profile;
|
||||
const nip05 = defaultNip ? defaultNip : user?.nip05;
|
||||
@ -81,6 +81,7 @@ export default function ProfileImage({
|
||||
user={user}
|
||||
size={size}
|
||||
imageOverlay={imageOverlay}
|
||||
showTitle={!showProfileCard}
|
||||
icons={
|
||||
showFollowDistance || icons ? (
|
||||
<>
|
||||
@ -105,7 +106,7 @@ export default function ProfileImage({
|
||||
}
|
||||
|
||||
function profileCard() {
|
||||
if ((showProfileCard ?? true) && user && isHovering) {
|
||||
if (showProfileCard && user && isHovering) {
|
||||
return (
|
||||
<div className="absolute shadow-lg z-10">
|
||||
<ProfileCard pubkey={pubkey} user={user} show={true} />
|
||||
|
Loading…
Reference in New Issue
Block a user