mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Premium story reactions info
This commit is contained in:
@@ -75,6 +75,8 @@ public final class DrawingEntitiesView: UIView, TGPhotoDrawingEntitiesView {
|
||||
public var getEntityAdditionalScale: () -> CGFloat = { return 1.0 }
|
||||
|
||||
public var getAvailableReactions: () -> [ReactionItem] = { return [] }
|
||||
public var present: (ViewController) -> Void = { _ in }
|
||||
public var push: (ViewController) -> Void = { _ in }
|
||||
|
||||
public var hasSelectionChanged: (Bool) -> Void = { _ in }
|
||||
var selectionChanged: (DrawingEntity?) -> Void = { _ in }
|
||||
|
||||
@@ -541,50 +541,21 @@ public final class DrawingStickerEntityView: DrawingEntityView {
|
||||
}
|
||||
|
||||
reactionContextNode.premiumReactionsSelected = { [weak self] file in
|
||||
let _ = self
|
||||
let _ = file
|
||||
// guard let self, let component = self.component else {
|
||||
// return
|
||||
// }
|
||||
//
|
||||
// guard let file else {
|
||||
// let context = component.context
|
||||
// var replaceImpl: ((ViewController) -> Void)?
|
||||
// let controller = PremiumDemoScreen(context: context, subject: .uniqueReactions, forceDark: true, action: {
|
||||
// let controller = PremiumIntroScreen(context: context, source: .reactions)
|
||||
// replaceImpl?(controller)
|
||||
// })
|
||||
// controller.disposed = { [weak self] in
|
||||
// self?.updateIsProgressPaused()
|
||||
// }
|
||||
// replaceImpl = { [weak controller] c in
|
||||
// controller?.replace(with: c)
|
||||
// }
|
||||
// component.controller()?.push(controller)
|
||||
// return
|
||||
// }
|
||||
//
|
||||
// let presentationData = component.context.sharedContext.currentPresentationData.with { $0 }
|
||||
// let undoController = UndoOverlayController(presentationData: presentationData, content: .sticker(context: component.context, file: file, loop: true, title: nil, text: presentationData.strings.Chat_PremiumReactionToastTitle, undoText: presentationData.strings.Chat_PremiumReactionToastAction, customAction: { [weak self] in
|
||||
// guard let self, let component = self.component else {
|
||||
// return
|
||||
// }
|
||||
//
|
||||
// let context = component.context
|
||||
// var replaceImpl: ((ViewController) -> Void)?
|
||||
// let controller = PremiumDemoScreen(context: context, subject: .uniqueReactions, forceDark: true, action: {
|
||||
// let controller = PremiumIntroScreen(context: context, source: .reactions)
|
||||
// replaceImpl?(controller)
|
||||
// })
|
||||
// controller.disposed = { [weak self] in
|
||||
// self?.updateIsProgressPaused()
|
||||
// }
|
||||
// replaceImpl = { [weak controller] c in
|
||||
// controller?.replace(with: c)
|
||||
// }
|
||||
// component.controller()?.push(controller)
|
||||
// }), elevatedLayout: false, animateInAsReplacement: false, blurred: true, action: { _ in true })
|
||||
// component.controller()?.present(undoController, in: .current)
|
||||
guard let self, let file else {
|
||||
return
|
||||
}
|
||||
|
||||
let context = self.context
|
||||
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
|
||||
|
||||
let controller = UndoOverlayController(presentationData: presentationData, content: .sticker(context: context, file: file, loop: true, title: nil, text: presentationData.strings.Story_Editor_TooltipPremiumReaction, undoText: nil, customAction: nil), elevatedLayout: true, animateInAsReplacement: false, blurred: true, action: { [weak self] action in
|
||||
if case .info = action, let self {
|
||||
let controller = context.sharedContext.makePremiumIntroController(context: context, source: .storiesExpirationDurations, forceDark: true, dismissed: nil)
|
||||
self.containerView?.push(controller)
|
||||
}
|
||||
return false
|
||||
})
|
||||
self.containerView?.present(controller)
|
||||
}
|
||||
|
||||
let anchorRect = self.convert(self.bounds, to: superview).offsetBy(dx: 0.0, dy: -20.0)
|
||||
|
||||
Reference in New Issue
Block a user