@@ -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
0 commit comments