Gifts: Small fixes (#5139)

This commit is contained in:
zubiden 2024-11-02 21:12:01 +04:00 committed by Alexander Zinchuk
parent 01dc204fa7
commit 3fae1b4242
4 changed files with 8 additions and 6 deletions

View File

@ -743,7 +743,7 @@ export default memo(withGlobal<OwnProps>(
const userFullInfo = isPrivate ? selectUserFullInfo(global, chatId) : undefined;
const chatFullInfo = !isPrivate ? selectChatFullInfo(global, chatId) : undefined;
const fullInfo = userFullInfo || chatFullInfo;
const canGift = !selectIsPremiumPurchaseBlocked(global) && !isChatWithSelf;
const canGift = !selectIsPremiumPurchaseBlocked(global) && !isChatWithSelf && isPrivate;
const topic = selectTopic(global, chatId, threadId);
const canCreateTopic = chat.isForum && (

View File

@ -26,6 +26,8 @@
background-color: var(--color-borders);
gap: 1px;
flex-shrink: 0;
overflow: hidden;
}

View File

@ -67,9 +67,6 @@ function GiftItemPremium({
role="button"
onClick={handleGiftClick}
>
{Boolean(discount) && (
<GiftRibbon color="red" text={lang('GiftDiscount', { percent: discount })} />
)}
<AnimatedIconFromSticker
sticker={sticker}
play={canPlayAnimatedEmojis}
@ -85,6 +82,9 @@ function GiftItemPremium({
<Button className={styles.buy} nonInteractive size="tiny" pill fluid>
{formatCurrencyAsString(amount, currency)}
</Button>
{Boolean(discount) && (
<GiftRibbon color="red" text={lang('GiftDiscount', { percent: discount })} />
)}
</div>
);
}

View File

@ -57,8 +57,6 @@ function GiftItemStar({ sticker, gift, onClick }: OwnProps & StateProps) {
role="button"
onClick={handleGiftClick}
>
{isLimited && !isSoldOut && <GiftRibbon color="blue" text={lang('GiftLimited')} />}
{isSoldOut && <GiftRibbon color="red" text={lang('GiftSoldOut')} />}
<AnimatedIconFromSticker
sticker={sticker}
noLoop
@ -71,6 +69,8 @@ function GiftItemStar({ sticker, gift, onClick }: OwnProps & StateProps) {
{stars}
</div>
</Button>
{isLimited && !isSoldOut && <GiftRibbon color="blue" text={lang('GiftLimited')} />}
{isSoldOut && <GiftRibbon color="red" text={lang('GiftSoldOut')} />}
</div>
);
}