Saved Gift: Fix price badge (#6104)

This commit is contained in:
Alexander Zinchuk 2025-08-15 18:25:26 +02:00
parent a4fb95a34a
commit c20d97a635
2 changed files with 11 additions and 4 deletions

View File

@ -44,6 +44,8 @@
position: absolute; position: absolute;
bottom: 0.5rem; bottom: 0.5rem;
overflow: visible;
height: 1.5rem !important; height: 1.5rem !important;
margin-top: 0.625rem; margin-top: 0.625rem;

View File

@ -7,6 +7,7 @@ import { STARS_CURRENCY_CODE, TON_CURRENCY_CODE } from '../../../config';
import { getHasAdminRight } from '../../../global/helpers'; import { getHasAdminRight } from '../../../global/helpers';
import { selectChat, selectPeer, selectUser } from '../../../global/selectors'; import { selectChat, selectPeer, selectUser } from '../../../global/selectors';
import buildClassName from '../../../util/buildClassName'; import buildClassName from '../../../util/buildClassName';
import buildStyle from '../../../util/buildStyle';
import { formatStarsAsIcon, formatTonAsIcon } from '../../../util/localization/format'; import { formatStarsAsIcon, formatTonAsIcon } from '../../../util/localization/format';
import { CUSTOM_PEER_HIDDEN } from '../../../util/objects/customPeer'; import { CUSTOM_PEER_HIDDEN } from '../../../util/objects/customPeer';
import { formatIntegerCompact } from '../../../util/textFormat'; import { formatIntegerCompact } from '../../../util/textFormat';
@ -119,9 +120,10 @@ const SavedGift = ({
const sticker = getStickerFromGift(gift.gift); const sticker = getStickerFromGift(gift.gift);
const radialPatternBackdrop = useMemo(() => { const giftAttributes = useMemo(() => getGiftAttributes(gift.gift), [gift.gift]);
const { backdrop, pattern } = getGiftAttributes(gift.gift) || {}; const { backdrop, pattern } = giftAttributes || {};
const radialPatternBackdrop = useMemo(() => {
if (!backdrop || !pattern) { if (!backdrop || !pattern) {
return undefined; return undefined;
} }
@ -137,7 +139,7 @@ const SavedGift = ({
patternIcon={pattern.sticker} patternIcon={pattern.sticker}
/> />
); );
}, [gift.gift]); }, [backdrop, pattern]);
if (!sticker) return undefined; if (!sticker) return undefined;
@ -178,9 +180,12 @@ const SavedGift = ({
{resellPrice && ( {resellPrice && (
<Button <Button
className={styles.priceBadge} className={styles.priceBadge}
style={buildStyle(
backdrop?.edgeColor && `background-color: ${backdrop.edgeColor} !important`,
backdrop?.centerColor && `box-shadow: 0 0.25rem 1rem ${backdrop.centerColor}`,
)}
nonInteractive nonInteractive
size="tiny" size="tiny"
color="bluredStarsBadge"
withSparkleEffect={true} withSparkleEffect={true}
pill pill
fluid fluid