no avatar title when profilecard is shown
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Martti Malmi 2023-11-29 14:36:24 +02:00
parent 51e68b1288
commit d84843a46d
2 changed files with 16 additions and 4 deletions

View File

@ -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}

View File

@ -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} />