@@ -13,8 +13,8 @@ import { getGiftAttributes, getStickerFromGift, getTotalGiftAvailability } from
13
13
import useContextMenuHandlers from '../../../hooks/useContextMenuHandlers' ;
14
14
import useFlag from '../../../hooks/useFlag' ;
15
15
import { type ObserveFn , useOnIntersect } from '../../../hooks/useIntersectionObserver' ;
16
+ import useLang from '../../../hooks/useLang' ;
16
17
import useLastCallback from '../../../hooks/useLastCallback' ;
17
- import useOldLang from '../../../hooks/useOldLang' ;
18
18
19
19
import Menu from '../../ui/Menu' ;
20
20
import AnimatedIconFromSticker from '../AnimatedIconFromSticker' ;
@@ -61,10 +61,17 @@ const SavedGift = ({
61
61
62
62
const [ shouldPlay , play ] = useFlag ( ) ;
63
63
64
- const oldLang = useOldLang ( ) ;
64
+ const lang = useLang ( ) ;
65
65
66
66
const canManage = peerId === currentUserId || hasAdminRights ;
67
67
68
+ const totalIssued = getTotalGiftAvailability ( gift . gift ) ;
69
+ const ribbonText = gift . isPinned && gift . gift . type === 'starGiftUnique'
70
+ ? lang ( 'GiftSavedNumber' , { number : gift . gift . number } )
71
+ : totalIssued
72
+ ? lang ( 'ActionStarGiftLimitedRibbon' , { total : formatIntegerCompact ( totalIssued ) } )
73
+ : undefined ;
74
+
68
75
const {
69
76
isContextMenuOpen, contextMenuAnchor,
70
77
handleBeforeContextMenu, handleContextMenu,
@@ -117,8 +124,6 @@ const SavedGift = ({
117
124
118
125
if ( ! sticker ) return undefined ;
119
126
120
- const totalIssued = getTotalGiftAvailability ( gift . gift ) ;
121
-
122
127
return (
123
128
< div
124
129
ref = { ref }
@@ -143,10 +148,10 @@ const SavedGift = ({
143
148
< Icon name = "eye-crossed-outline" />
144
149
</ div >
145
150
) }
146
- { totalIssued && (
151
+ { ribbonText && (
147
152
< GiftRibbon
148
153
color = "blue"
149
- text = { oldLang ( 'Gift2Limited1OfRibbon' , formatIntegerCompact ( totalIssued ) ) }
154
+ text = { ribbonText }
150
155
/>
151
156
) }
152
157
{ contextMenuAnchor !== undefined && (
0 commit comments