small profile-card fix

Signed-off-by: Shea Duma <[email protected]>
This commit is contained in:
Shea Duma committed 2026-05-23 12:19:37 +03:00
1 parent 4c4d146a9f
commit e02f12736d
3 files changed
+15 -4

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
---
default: patch
---
Fix unset User Profile cards having incorectly colored text.
+7 -2
View File
@@ -283,8 +283,13 @@ export const useUserProfile = (
const resolvedPronouns = localPronouns || spacePronouns || data?.pronouns;
const rawHeroBrightness = data?.heroColorScheme?.brightness;
const heroCardsAllowed = shouldApplyUserHeroCards(renderUserCardsMode, rawHeroBrightness);
const validHeroColor = heroCardsAllowed ? isValidHex(data?.heroColorScheme?.color) : undefined;
const rawHeroColor = data?.heroColorScheme?.color;
const heroCardsAllowed = shouldApplyUserHeroCards(
renderUserCardsMode,
rawHeroBrightness,
rawHeroColor
);
const validHeroColor = heroCardsAllowed ? isValidHex(rawHeroColor) : undefined;
const heroBrightness = heroCardsAllowed ? rawHeroBrightness : undefined;
const testUserHeroColor = shadeColor(validHeroColor, heroBrightness === 'dark' ? -80 : 80);
+3 -2
View File
@@ -68,11 +68,12 @@ export function isPixelatedViewerRendering(mode: PixelatedImageRenderingMode): b
export function shouldApplyUserHeroCards(
mode: RenderUserCardsMode,
brightness: string | undefined
brightness?: string,
color?: string
): boolean {
if (!color || (brightness !== 'light' && brightness !== 'dark')) return false;
if (mode === 'none') return false;
if (mode === 'both') return true;
if (brightness !== 'light' && brightness !== 'dark') return false;
return brightness === mode;
}