mirror of
https://github.com/SableClient/Sable.git
synced 2026-11-21 09:31:17 -08:00
1 parent
4c4d146a9f
commit
e02f12736d
3 files changed
+15
-4
No files matched your search
@@ -0,0 +1,5 @@
|
||||
---
|
||||
default: patch
|
||||
---
|
||||
|
||||
Fix unset User Profile cards having incorectly colored text.
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user