From c2224b6e52e38d1c59e08b6bdde840a76e5b56d6 Mon Sep 17 00:00:00 2001 From: zubiden <19638254+zubiden@users.noreply.github.com> Date: Thu, 6 Nov 2025 11:36:59 +0100 Subject: [PATCH] Profile: Fix displaying emoji pattern without color (#6448) --- .../common/profile/ProfileInfo.module.scss | 10 ++++++++++ src/components/common/profile/ProfileInfo.tsx | 16 ++++++++++------ .../profile/RadialPatternBackground.module.scss | 2 ++ .../common/profile/RadialPatternBackground.tsx | 16 ++++++++++------ src/global/selectors/peers.ts | 5 ++++- 5 files changed, 36 insertions(+), 13 deletions(-) diff --git a/src/components/common/profile/ProfileInfo.module.scss b/src/components/common/profile/ProfileInfo.module.scss index 6c7d74b96..ea324625b 100644 --- a/src/components/common/profile/ProfileInfo.module.scss +++ b/src/components/common/profile/ProfileInfo.module.scss @@ -14,6 +14,8 @@ color: var(--color-white); + background-color: var(--color-background); + @include mixins.with-vt-type('profileAvatar'); :global(.VerifiedIcon), @@ -30,6 +32,10 @@ padding-block: 1.5rem 0; color: var(--color-text); + .info { + background-image: linear-gradient(0deg, var(--color-background) 50%, transparent); + } + .userRatingNegativeWrapper, .userRatingWrapper { color: var(--color-white); @@ -43,6 +49,10 @@ opacity: 1; } + :global(.title .custom-emoji) { + color: var(--color-primary); + } + :global(.VerifiedIcon), :global(.StarIcon) { --color-fill: var(--color-primary); diff --git a/src/components/common/profile/ProfileInfo.tsx b/src/components/common/profile/ProfileInfo.tsx index 2557e8a86..9e28ad09a 100644 --- a/src/components/common/profile/ProfileInfo.tsx +++ b/src/components/common/profile/ProfileInfo.tsx @@ -69,8 +69,6 @@ import RadialPatternBackground from './RadialPatternBackground.tsx'; import './ProfileInfo.scss'; import styles from './ProfileInfo.module.scss'; -const MAX_LEVEL_ICON = 90; - type OwnProps = { isExpanded?: boolean; peerId: string; @@ -101,12 +99,16 @@ type StateProps = { hasAvatar?: boolean; }; +const MAX_LEVEL_ICON = 90; + const EMOJI_STATUS_SIZE = 24; const EMOJI_TOPIC_SIZE = 120; const LOAD_MORE_THRESHOLD = 3; const MAX_PHOTO_DASH_COUNT = 30; const STATUS_UPDATE_INTERVAL = 1000 * 60; // 1 min + const PATTERN_Y_SHIFT = 8 * REM; +const PATTERN_PLAIN_Y_SHIFT = 5.25 * REM; const ProfileInfo = ({ isExpanded, @@ -187,6 +189,8 @@ const ProfileInfo = ({ }; }, [profileColorOption, theme, collectibleEmojiStatus]); + const hasPatternBackground = profileColorSet?.bgColors || backgroundEmoji; + const pinnedGifts = useMemo(() => { return savedGifts?.gifts.filter((gift) => { if (gift.gift.type === 'starGiftUnique') { @@ -491,17 +495,17 @@ const ProfileInfo = ({ )} dir={lang.isRtl ? 'rtl' : undefined} > - {profileColorSet?.bgColors && ( + {hasPatternBackground && ( )} - {pinnedGifts && ( + {Boolean(pinnedGifts?.length) && ( diff --git a/src/global/selectors/peers.ts b/src/global/selectors/peers.ts index 13edd8746..7c05117b8 100644 --- a/src/global/selectors/peers.ts +++ b/src/global/selectors/peers.ts @@ -72,7 +72,10 @@ export function selectPeerPaidMessagesStars( export function selectPeerHasProfileBackground(global: T, peerId: string) { const peer = selectPeer(global, peerId); - return Boolean(peer?.profileColor || peer?.emojiStatus?.type === 'collectible'); + const profileColor = peer?.profileColor; + if (profileColor?.type === 'collectible') return true; + if (profileColor?.type === 'regular') return profileColor.color !== undefined; + return peer?.emojiStatus?.type === 'collectible'; } export function selectCanUpdateMainTab(global: T, peerId: string) {