Gift Modal: Hide first and last sale dates (#5788)
This commit is contained in:
parent
9a2f47c619
commit
fc2d973453
@ -185,6 +185,22 @@ const GiftInfoModal = ({
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const saleDateInfo = useMemo(() => {
|
||||||
|
if (!gift) return undefined;
|
||||||
|
let text = '';
|
||||||
|
if (gift.type === 'starGift') {
|
||||||
|
if (gift.firstSaleDate) {
|
||||||
|
text += `${lang('GiftInfoFirstSale')} ${formatDateTimeToString(gift.firstSaleDate * 1000, lang.code, true)}`;
|
||||||
|
}
|
||||||
|
if (gift.lastSaleDate) {
|
||||||
|
text += '\n';
|
||||||
|
text += `${lang('GiftInfoLastSale')} ${formatDateTimeToString(gift.lastSaleDate * 1000, lang.code, true)}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return text;
|
||||||
|
}, [gift, lang]);
|
||||||
|
|
||||||
const modalData = useMemo(() => {
|
const modalData = useMemo(() => {
|
||||||
if (!typeGift || !gift) {
|
if (!typeGift || !gift) {
|
||||||
return undefined;
|
return undefined;
|
||||||
@ -359,18 +375,18 @@ const GiftInfoModal = ({
|
|||||||
if (savedGift?.date) {
|
if (savedGift?.date) {
|
||||||
tableData.push([
|
tableData.push([
|
||||||
lang('GiftInfoDate'),
|
lang('GiftInfoDate'),
|
||||||
formatDateTimeToString(savedGift.date * 1000, lang.code, true),
|
<span title={saleDateInfo}>{formatDateTimeToString(savedGift.date * 1000, lang.code, true)}</span>,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gift.firstSaleDate) {
|
if (gift.firstSaleDate && !savedGift) {
|
||||||
tableData.push([
|
tableData.push([
|
||||||
lang('GiftInfoFirstSale'),
|
lang('GiftInfoFirstSale'),
|
||||||
formatDateTimeToString(gift.firstSaleDate * 1000, lang.code, true),
|
formatDateTimeToString(gift.firstSaleDate * 1000, lang.code, true),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gift.lastSaleDate) {
|
if (gift.lastSaleDate && !savedGift) {
|
||||||
tableData.push([
|
tableData.push([
|
||||||
lang('GiftInfoLastSale'),
|
lang('GiftInfoLastSale'),
|
||||||
formatDateTimeToString(gift.lastSaleDate * 1000, lang.code, true),
|
formatDateTimeToString(gift.lastSaleDate * 1000, lang.code, true),
|
||||||
@ -602,7 +618,7 @@ const GiftInfoModal = ({
|
|||||||
canManage, hasConvertOption, isSender, oldLang, tonExplorerUrl,
|
canManage, hasConvertOption, isSender, oldLang, tonExplorerUrl,
|
||||||
gift, giftAttributes, renderFooterButton, isTargetChat,
|
gift, giftAttributes, renderFooterButton, isTargetChat,
|
||||||
SettingsMenuButton, isOpen, isGiftUnique, renderingModal,
|
SettingsMenuButton, isOpen, isGiftUnique, renderingModal,
|
||||||
collectibleEmojiStatuses, currentUserEmojiStatus,
|
collectibleEmojiStatuses, currentUserEmojiStatus, saleDateInfo,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user