mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Content reporting
This commit is contained in:
@@ -25,6 +25,7 @@ import GalleryUI
|
||||
import StarsAvatarComponent
|
||||
import MiniAppListScreen
|
||||
import PremiumStarComponent
|
||||
import GiftAnimationComponent
|
||||
|
||||
private final class StarsTransactionSheetContent: CombinedComponent {
|
||||
typealias EnvironmentType = ViewControllerComponentContainer.Environment
|
||||
@@ -145,6 +146,7 @@ private final class StarsTransactionSheetContent: CombinedComponent {
|
||||
let title = Child(MultilineTextComponent.self)
|
||||
let star = Child(StarsImageComponent.self)
|
||||
let activeStar = Child(PremiumStarComponent.self)
|
||||
let gift = Child(GiftAnimationComponent.self)
|
||||
let amountBackground = Child(RoundedRectangle.self)
|
||||
let amount = Child(BalancedTextComponent.self)
|
||||
let amountStar = Child(BundleIconComponent.self)
|
||||
@@ -225,6 +227,7 @@ private final class StarsTransactionSheetContent: CombinedComponent {
|
||||
var isReaction = false
|
||||
var giveawayMessageId: MessageId?
|
||||
var isBoost = false
|
||||
var giftAnimation: TelegramMediaFile?
|
||||
|
||||
var delayedCloseOnOpenPeer = true
|
||||
switch subject {
|
||||
@@ -322,7 +325,18 @@ private final class StarsTransactionSheetContent: CombinedComponent {
|
||||
}
|
||||
}
|
||||
case let .transaction(transaction, parentPeer):
|
||||
if let giveawayMessageIdValue = transaction.giveawayMessageId {
|
||||
if let starGift = transaction.starGift {
|
||||
titleText = "Gift"
|
||||
descriptionText = ""
|
||||
count = transaction.count
|
||||
transactionId = transaction.id
|
||||
date = transaction.date
|
||||
if case let .peer(peer) = transaction.peer {
|
||||
toPeer = peer
|
||||
}
|
||||
transactionPeer = transaction.peer
|
||||
giftAnimation = starGift.file
|
||||
} else if let giveawayMessageIdValue = transaction.giveawayMessageId {
|
||||
titleText = strings.Stars_Transaction_Giveaway_Title
|
||||
descriptionText = ""
|
||||
count = transaction.count
|
||||
@@ -572,7 +586,17 @@ private final class StarsTransactionSheetContent: CombinedComponent {
|
||||
imageIcon = nil
|
||||
}
|
||||
var starChild: _UpdatedChildComponent
|
||||
if isBoost {
|
||||
if let giftAnimation {
|
||||
starChild = gift.update(
|
||||
component: GiftAnimationComponent(
|
||||
context: component.context,
|
||||
theme: theme,
|
||||
file: giftAnimation
|
||||
),
|
||||
availableSize: CGSize(width: 128.0, height: 128.0),
|
||||
transition: .immediate
|
||||
)
|
||||
} else if isBoost {
|
||||
starChild = activeStar.update(
|
||||
component: PremiumStarComponent(
|
||||
theme: theme,
|
||||
@@ -877,7 +901,7 @@ private final class StarsTransactionSheetContent: CombinedComponent {
|
||||
)
|
||||
|
||||
context.add(starChild
|
||||
.position(CGPoint(x: context.availableSize.width / 2.0, y: starChild.size.height / 2.0 - 19.0))
|
||||
.position(CGPoint(x: context.availableSize.width / 2.0, y: 200.0 / 2.0 - 19.0))
|
||||
)
|
||||
|
||||
context.add(title
|
||||
@@ -885,7 +909,7 @@ private final class StarsTransactionSheetContent: CombinedComponent {
|
||||
)
|
||||
|
||||
var originY: CGFloat = 0.0
|
||||
originY += starChild.size.height - 23.0
|
||||
originY += 200.0 - 23.0
|
||||
|
||||
var descriptionSize: CGSize = .zero
|
||||
if !descriptionText.isEmpty {
|
||||
|
||||
Reference in New Issue
Block a user