Skip to content

Commit a05e19e

Browse files
author
Isaac
committed
Merge commit '0e1b60be249a798e0a5c2ff6616ed2437c8a95db'
2 parents e56c345 + 0e1b60b commit a05e19e

File tree

10 files changed

+175
-179
lines changed

10 files changed

+175
-179
lines changed

Telegram/Telegram-iOS/en.lproj/Localizable.strings

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15423,3 +15423,6 @@ Error: %8$@";
1542315423
"ChatList.AlertResumeLiveStreamTitle" = "Resume Live Stream";
1542415424
"ChatList.AlertResumeLiveStreamText" = "Do you want to resume an existing Live Stream?";
1542515425
"ChatList.AlertResumeLiveStreamAction" = "Resume";
15426+
15427+
"Gift.Options.Gift.JoinAuction" = "Join";
15428+
"Gift.Options.Gift.ViewAuction" = "View";

submodules/Components/SheetComponent/Sources/SheetComponent.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,10 @@ public final class SheetComponent<ChildEnvironmentType: Sendable & Equatable>: C
400400
self.component = component
401401
self.currentHasInputHeight = sheetEnvironment.hasInputHeight
402402

403+
if self.isAnimatingOut {
404+
return availableSize
405+
}
406+
403407
var glassInset: CGFloat = 0.0
404408
var topCornerRadius: CGFloat
405409
var bottomCornerRadius: CGFloat

submodules/TelegramBaseController/Sources/GiftAuctionAccessoryPanel.swift

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -106,22 +106,6 @@ final class GiftAuctionAccessoryPanel: ASDisplayNode {
106106
let titleText: String = self.strings.ChatList_Auctions_ActiveAuction(Int32(self.states.count))
107107
titleItems.append(AnyComponentWithIdentity(id: "label", component: AnyComponent(MultilineTextComponent(text: .plain(NSAttributedString(string: titleText, font: titleFont, textColor: self.theme.rootController.navigationBar.primaryTextColor))))))
108108

109-
let titleSize = self.title.update(
110-
transition: .immediate,
111-
component: AnyComponent(
112-
HStack(titleItems, spacing: 3.0, alignment: .left)
113-
),
114-
environment: {},
115-
containerSize: size
116-
)
117-
let titleFrame = CGRect(origin: CGPoint(x: 16.0, y: 9.0), size: titleSize)
118-
if let titleView = self.title.view {
119-
if titleView.superview == nil {
120-
self.contentNode.view.addSubview(titleView)
121-
}
122-
titleView.frame = titleFrame
123-
}
124-
125109
let subtitleText: String
126110
var subtitleTextColor = self.theme.rootController.navigationBar.secondaryTextColor
127111
var isOutbid = false
@@ -195,20 +179,6 @@ final class GiftAuctionAccessoryPanel: ASDisplayNode {
195179
buttonAnimatedTitleItems.append(AnimatedTextComponent.Item(id: "view", content: .text(self.strings.ChatList_Auctions_View)))
196180
}
197181

198-
let subtitleSize = self.subtitle.update(
199-
transition: .immediate,
200-
component: AnyComponent(MultilineTextComponent(text: .plain(NSAttributedString(string: subtitleText, font: subtitleFont, textColor: subtitleTextColor)))),
201-
environment: {},
202-
containerSize: size
203-
)
204-
let subtitleFrame = CGRect(origin: CGPoint(x: 16.0, y: 29.0), size: subtitleSize)
205-
if let subtitleView = self.subtitle.view {
206-
if subtitleView.superview == nil {
207-
self.contentNode.view.addSubview(subtitleView)
208-
}
209-
subtitleView.frame = subtitleFrame
210-
}
211-
212182
let buttonSize = self.button.update(
213183
transition: .spring(duration: 0.2),
214184
component: AnyComponent(
@@ -254,6 +224,36 @@ final class GiftAuctionAccessoryPanel: ASDisplayNode {
254224
buttonView.frame = buttonFrame
255225
}
256226

227+
let titleSize = self.title.update(
228+
transition: .immediate,
229+
component: AnyComponent(
230+
HStack(titleItems, spacing: 3.0, alignment: .left)
231+
),
232+
environment: {},
233+
containerSize: CGSize(width: size.width - buttonSize.width - 48.0, height: size.height)
234+
)
235+
let titleFrame = CGRect(origin: CGPoint(x: 16.0, y: 9.0), size: titleSize)
236+
if let titleView = self.title.view {
237+
if titleView.superview == nil {
238+
self.contentNode.view.addSubview(titleView)
239+
}
240+
titleView.frame = titleFrame
241+
}
242+
243+
let subtitleSize = self.subtitle.update(
244+
transition: .immediate,
245+
component: AnyComponent(MultilineTextComponent(text: .plain(NSAttributedString(string: subtitleText, font: subtitleFont, textColor: subtitleTextColor)))),
246+
environment: {},
247+
containerSize: CGSize(width: size.width - buttonSize.width - 40.0, height: size.height)
248+
)
249+
let subtitleFrame = CGRect(origin: CGPoint(x: 16.0, y: 29.0), size: subtitleSize)
250+
if let subtitleView = self.subtitle.view {
251+
if subtitleView.superview == nil {
252+
self.contentNode.view.addSubview(subtitleView)
253+
}
254+
subtitleView.frame = subtitleFrame
255+
}
256+
257257
transition.updateFrame(node: self.separatorNode, frame: CGRect(origin: CGPoint(x: 0.0, y: 0.0), size: CGSize(width: size.width, height: UIScreenPixel)))
258258
}
259259

submodules/TelegramUI/Components/Gifts/GiftOptionsScreen/Sources/GiftOptionsScreen.swift

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,11 @@ final class GiftOptionsScreenComponent: Component {
658658
switch gift {
659659
case let .generic(gift):
660660
if gift.flags.contains(.isAuction) {
661-
subject = .starGift(gift: gift, price: "Join")
661+
var action = environment.strings.Gift_Options_Gift_JoinAuction
662+
if gift.availability?.remains == 0 {
663+
action = environment.strings.Gift_Options_Gift_ViewAuction
664+
}
665+
subject = .starGift(gift: gift, price: action)
662666
} else if let availability = gift.availability, availability.remains == 0, let minResaleStars = availability.minResaleStars {
663667
let priceString = presentationStringsFormattedNumber(Int32(minResaleStars), environment.dateTimeFormat.groupingSeparator)
664668
if let resaleConfiguration = self.resaleConfiguration, minResaleStars == resaleConfiguration.starGiftResaleMaxStarsAmount || availability.resale == 1 {
@@ -1823,6 +1827,14 @@ final class GiftOptionsScreenComponent: Component {
18231827
}
18241828

18251829
var filteredStarGifts = starGifts
1830+
if peerId.namespace == Namespaces.Peer.CloudChannel {
1831+
filteredStarGifts = filteredStarGifts?.filter { gift in
1832+
if case let .generic(gift) = gift, gift.availability != nil {
1833+
return false
1834+
}
1835+
return true
1836+
}
1837+
}
18261838
if let disallowedGifts = self.disallowedGifts, !disallowedGifts.isEmpty {
18271839
filteredStarGifts = filteredStarGifts?.filter { gift in
18281840
if case let .generic(gift) = gift {

0 commit comments

Comments
 (0)