GiftInfoModal: Update upgrade button (#6101)

This commit is contained in:
Alexander Zinchuk 2025-08-15 18:25:21 +02:00
parent 6d39fd28d8
commit e2b8058c77
4 changed files with 24 additions and 2 deletions

View File

@ -1439,6 +1439,7 @@
"GiftInfoPeerDescriptionOutConverted_one" = "{peer} converted this gift to **{amount}** Star."; "GiftInfoPeerDescriptionOutConverted_one" = "{peer} converted this gift to **{amount}** Star.";
"GiftInfoPeerDescriptionOutConverted_other" = "{peer} converted this gift to **{amount}** Stars."; "GiftInfoPeerDescriptionOutConverted_other" = "{peer} converted this gift to **{amount}** Stars.";
"GiftInfoDescriptionFreeUpgrade" = "Upgrade this gift for free to turn it to a unique collectible."; "GiftInfoDescriptionFreeUpgrade" = "Upgrade this gift for free to turn it to a unique collectible.";
"GiftInfoDescriptionUpgrade" = "Upgrade this gift to turn it to a unique collectible.";
"GiftInfoPeerDescriptionFreeUpgradeOut" = "{peer} can turn this gift to a unique collectible"; "GiftInfoPeerDescriptionFreeUpgradeOut" = "{peer} can turn this gift to a unique collectible";
"GiftInfoDescriptionUpgraded" = "This gift was turned into a unique collectible."; "GiftInfoDescriptionUpgraded" = "This gift was turned into a unique collectible.";
"GiftInfoFrom" = "From"; "GiftInfoFrom" = "From";
@ -1487,6 +1488,7 @@
"GiftInfoViewUpgraded" = "View Upgraded Gift"; "GiftInfoViewUpgraded" = "View Upgraded Gift";
"GiftInfoUpgradeBadge" = "upgrade"; "GiftInfoUpgradeBadge" = "upgrade";
"GiftInfoUpgradeForFree" = "Upgrade For Free"; "GiftInfoUpgradeForFree" = "Upgrade For Free";
"GiftInfoUpgrade" = "Upgrade";
"GiftInfoWithdraw" = "Withdraw"; "GiftInfoWithdraw" = "Withdraw";
"GiftInfoWear" = "Wear"; "GiftInfoWear" = "Wear";
"GiftInfoTakeOff" = "Take Off"; "GiftInfoTakeOff" = "Take Off";

View File

@ -16,6 +16,12 @@
color: var(--color-text-secondary); color: var(--color-text-secondary);
} }
.upgradeIcon {
transform: rotateX(180deg);
margin-left: 0.25rem;
font-size: 1.25rem;
}
.header { .header {
display: flex; display: flex;
flex-direction: column; flex-direction: column;

View File

@ -272,6 +272,16 @@ const GiftInfoModal = ({
return ( return (
<Button size="smaller" isShiny onClick={handleOpenUpgradeModal}> <Button size="smaller" isShiny onClick={handleOpenUpgradeModal}>
{lang('GiftInfoUpgradeForFree')} {lang('GiftInfoUpgradeForFree')}
<Icon name="arrow-down-circle" className={styles.upgradeIcon} />
</Button>
);
}
if (canManage && savedGift.canUpgrade && !savedGift.upgradeMsgId) {
return (
<Button size="smaller" isShiny onClick={handleOpenUpgradeModal}>
{lang('GiftInfoUpgrade')}
<Icon name="arrow-down-circle" className={styles.upgradeIcon} />
</Button> </Button>
); );
} }
@ -316,7 +326,10 @@ const GiftInfoModal = ({
if (isTargetChat) return undefined; if (isTargetChat) return undefined;
if (savedGift.upgradeMsgId) return lang('GiftInfoDescriptionUpgraded'); if (savedGift.upgradeMsgId) return lang('GiftInfoDescriptionUpgraded');
if (savedGift.canUpgrade && savedGift.alreadyPaidUpgradeStars) { if (canManage && savedGift.canUpgrade && savedGift.alreadyPaidUpgradeStars && !savedGift.upgradeMsgId) {
return lang('GiftInfoDescriptionUpgrade');
}
if (savedGift.canUpgrade && canManage) {
return canManage return canManage
? lang('GiftInfoDescriptionFreeUpgrade') ? lang('GiftInfoDescriptionFreeUpgrade')
: lang('GiftInfoPeerDescriptionFreeUpgradeOut', { peer: getPeerTitle(lang, renderingTargetPeer!)! }); : lang('GiftInfoPeerDescriptionFreeUpgradeOut', { peer: getPeerTitle(lang, renderingTargetPeer!)! });
@ -547,7 +560,6 @@ const GiftInfoModal = ({
lang('GiftInfoStatus'), lang('GiftInfoStatus'),
<div className={styles.giftValue}> <div className={styles.giftValue}>
{lang('GiftInfoStatusNonUnique')} {lang('GiftInfoStatusNonUnique')}
{canManage && <BadgeButton onClick={handleOpenUpgradeModal}>{lang('GiftInfoUpgradeBadge')}</BadgeButton>}
</div>, </div>,
]); ]);
} }

View File

@ -1208,6 +1208,7 @@ export interface LangPair {
'GiftInfoDescriptionRegular': undefined; 'GiftInfoDescriptionRegular': undefined;
'GiftInfoDescriptionUpgradeRegular': undefined; 'GiftInfoDescriptionUpgradeRegular': undefined;
'GiftInfoDescriptionFreeUpgrade': undefined; 'GiftInfoDescriptionFreeUpgrade': undefined;
'GiftInfoDescriptionUpgrade': undefined;
'GiftInfoDescriptionUpgraded': undefined; 'GiftInfoDescriptionUpgraded': undefined;
'GiftInfoFrom': undefined; 'GiftInfoFrom': undefined;
'GiftInfoDate': undefined; 'GiftInfoDate': undefined;
@ -1234,6 +1235,7 @@ export interface LangPair {
'GiftInfoViewUpgraded': undefined; 'GiftInfoViewUpgraded': undefined;
'GiftInfoUpgradeBadge': undefined; 'GiftInfoUpgradeBadge': undefined;
'GiftInfoUpgradeForFree': undefined; 'GiftInfoUpgradeForFree': undefined;
'GiftInfoUpgrade': undefined;
'GiftInfoWithdraw': undefined; 'GiftInfoWithdraw': undefined;
'GiftInfoWear': undefined; 'GiftInfoWear': undefined;
'GiftInfoTakeOff': undefined; 'GiftInfoTakeOff': undefined;