fix: simplify profile color preview logic in ProfileBanner component

This commit is contained in:
2026-04-09 02:15:24 +10:00
parent 0659f3c1b0
commit 13a235e99f

View File

@@ -574,7 +574,7 @@ function ProfileBanner({ avatarRef, nameRef }: { avatarRef: React.RefObject<HTML
: profileStyle.avatarBorderColor; : profileStyle.avatarBorderColor;
const previewPillBgColor = previewBorderColor ? stripAlphaFromColor(previewBorderColor) : undefined; const previewPillBgColor = previewBorderColor ? stripAlphaFromColor(previewBorderColor) : undefined;
const previewProfileColor = previewBorderColor ? stripAlphaFromColor(previewBorderColor) : (userColor || colorMXID(userId)); const previewProfileColor = userColor || colorMXID(userId);
const previewTextShadow = `0 1px 4px ${getTextShadowColor(previewProfileColor)}`; const previewTextShadow = `0 1px 4px ${getTextShadowColor(previewProfileColor)}`;
@@ -612,7 +612,7 @@ function ProfileBanner({ avatarRef, nameRef }: { avatarRef: React.RefObject<HTML
cursor: 'pointer', cursor: 'pointer',
border: 'none', border: 'none',
padding: 0, padding: 0,
backgroundColor: bannerBlobUrl ? 'transparent' : colorMXID(userId), backgroundColor: bannerBlobUrl ? 'transparent' : (userColor || colorMXID(userId)),
filter: bannerBlobUrl || authenticatedCoverUrl ? 'none' : 'brightness(50%)', filter: bannerBlobUrl || authenticatedCoverUrl ? 'none' : 'brightness(50%)',
display: 'flex', display: 'flex',
alignItems: 'center', alignItems: 'center',