Various improvements

This commit is contained in:
Ilya Laktyushin
2022-05-22 01:05:56 +04:00
parent 1dde73148a
commit b0396c8d15
10 changed files with 68 additions and 19 deletions

View File

@@ -14,6 +14,7 @@ import ContextUI
import MoreButtonNode
import UndoUI
import ShareController
import PremiumUI
private enum StickerPackPreviewGridEntry: Comparable, Identifiable {
case sticker(index: Int, stableId: Int, stickerItem: StickerPackItem?, isEmpty: Bool, isPremium: Bool, isLocked: Bool)
@@ -369,8 +370,14 @@ private final class StickerPackContainer: ASDisplayNode {
}
})))
}
return (itemNode, StickerPreviewPeekContent(account: strongSelf.context.account, theme: strongSelf.presentationData.theme, strings: strongSelf.presentationData.strings, item: .pack(item), isLocked: item.file.isPremiumSticker && !hasPremium, menu: menuItems, openPremiumIntro: {
return (itemNode, StickerPreviewPeekContent(account: strongSelf.context.account, theme: strongSelf.presentationData.theme, strings: strongSelf.presentationData.strings, item: .pack(item), isLocked: item.file.isPremiumSticker && !hasPremium, menu: menuItems, openPremiumIntro: { [weak self] in
guard let strongSelf = self else {
return
}
let controller = PremiumIntroScreen(context: strongSelf.context, source: .stickers)
let navigationController = strongSelf.controller?.parentNavigationController
strongSelf.controller?.dismiss(animated: false, completion: nil)
navigationController?.pushViewController(controller)
}))
} else {
return nil