@@ -775,17 +775,31 @@ public final class PeerInfoGiftsPaneNode: ASDisplayNode, PeerInfoPaneNode, UIScr
775
775
let buttonSideInset = sideInset + 16.0
776
776
777
777
let buttonTitle : String
778
+ var buttonIconName : String ?
778
779
if self . peerId == self . context. account. peerId {
779
780
if case . all = self . currentCollection {
780
781
buttonTitle = params. presentationData. strings. PeerInfo_Gifts_Send
781
782
} else {
782
783
buttonTitle = params. presentationData. strings. PeerInfo_Gifts_AddGiftsButton
784
+ buttonIconName = " Item List/AddItemIcon "
783
785
}
784
786
} else {
785
787
buttonTitle = params. presentationData. strings. PeerInfo_Gifts_SendGift
786
788
}
787
789
788
790
let buttonAttributedString = NSAttributedString ( string: buttonTitle, font: Font . semibold ( 17.0 ) , textColor: . white, paragraphAlignment: . center)
791
+ var buttonTitleContent : AnyComponent < Empty > = AnyComponent ( MultilineTextComponent ( text: . plain( buttonAttributedString) ) )
792
+ if let buttonIconName {
793
+ buttonTitleContent = AnyComponent ( HStack ( [
794
+ AnyComponentWithIdentity ( id: " _icon " , component: AnyComponent ( BundleIconComponent (
795
+ name: buttonIconName,
796
+ tintColor: presentationData. theme. list. itemCheckColors. foregroundColor,
797
+ maxSize: CGSize ( width: 18.0 , height: 18.0 )
798
+ ) ) ) ,
799
+ AnyComponentWithIdentity ( id: " _title " , component: buttonTitleContent)
800
+ ] , spacing: 7.0 ) )
801
+ }
802
+
789
803
let panelButtonSize = panelButton. update (
790
804
transition: transition,
791
805
component: AnyComponent (
@@ -796,8 +810,8 @@ public final class PeerInfoGiftsPaneNode: ASDisplayNode, PeerInfoPaneNode, UIScr
796
810
pressedColor: presentationData. theme. list. itemCheckColors. fillColor. withMultipliedAlpha ( 0.8 )
797
811
) ,
798
812
content: AnyComponentWithIdentity (
799
- id: AnyHashable ( buttonAttributedString . string ) ,
800
- component: AnyComponent ( MultilineTextComponent ( text : . plain ( buttonAttributedString ) ) )
813
+ id: AnyHashable ( buttonTitle ) ,
814
+ component: buttonTitleContent
801
815
) ,
802
816
isEnabled: true ,
803
817
action: { [ weak self] in
0 commit comments