last notes opacity, avoid profile linking

This commit is contained in:
Alejandro Gomez 2023-02-12 21:44:59 +01:00 committed by Kieran
parent 4cd174092a
commit 05a024e985
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
3 changed files with 11 additions and 2 deletions

View File

@ -18,6 +18,7 @@ export interface ProfileImageProps {
link?: string;
defaultNip?: string;
verifyNip?: boolean;
linkToProfile?: boolean;
}
export default function ProfileImage({
@ -28,6 +29,7 @@ export default function ProfileImage({
link,
defaultNip,
verifyNip,
linkToProfile = true,
}: ProfileImageProps) {
const navigate = useNavigate();
const user = useUserProfile(pubkey);
@ -42,10 +44,16 @@ export default function ProfileImage({
link = "#";
}
const onAvatarClick = () => {
if (linkToProfile) {
navigate(link ?? profileLink(pubkey));
}
};
return (
<div className={`pfp${className ? ` ${className}` : ""}`}>
<div className="avatar-wrapper">
<Avatar user={user} onClick={() => navigate(link ?? profileLink(pubkey))} />
<Avatar user={user} onClick={onAvatarClick} />
</div>
{showUsername && (
<div className="profile-name">

View File

@ -15,6 +15,7 @@
box-shadow: 0px 0px 15px rgba(78, 0, 255, 0.6);
border-radius: 100px;
z-index: 42;
opacity: 0.8;
}
@media (max-width: 520px) {

View File

@ -89,7 +89,7 @@ export default function Timeline({
{latestFeed.length > 0 && (
<div className="card latest-notes pointer" onClick={() => showLatest()}>
{latestAuthors.slice(0, 3).map(p => {
return <ProfileImage pubkey={p} showUsername={false} />;
return <ProfileImage pubkey={p} showUsername={false} linkToProfile={false} />;
})}
<FormattedMessage
defaultMessage="{n} new {n, plural, =1 {note} other {notes}}"