mirror of
https://github.com/ichmagmaus111/ghostgram.git
synced 2026-04-25 09:05:58 +02:00
db53826061
- Migrated project to latest Telegram iOS base (v12.3.2+) - Fixed circular dependency between GhostModeManager and MiscSettingsManager - Fixed multiple Bazel build configuration errors (select() default conditions) - Fixed duplicate type definitions in PeerInfoScreen - Fixed swiftmodule directory resolution in build scripts - Added Ghostgram Settings tab in main Settings menu with all 5 features - Cleared sensitive credentials from config.json (template-only now) - Excluded bazel-cache from version control
78 lines
2.9 KiB
Swift
78 lines
2.9 KiB
Swift
import Foundation
|
|
import UIKit
|
|
import SwiftSignalKit
|
|
import AsyncDisplayKit
|
|
import Display
|
|
import ComponentFlow
|
|
import TelegramCore
|
|
import TelegramPresentationData
|
|
import AccountContext
|
|
import AppBundle
|
|
import AlertComponent
|
|
import AlertTransferHeaderComponent
|
|
import AvatarComponent
|
|
|
|
func giftAuctionTransferController(context: AccountContext, fromPeer: EnginePeer, toPeer: EnginePeer, commit: @escaping () -> Void) -> AlertScreen {
|
|
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
|
|
let strings = presentationData.strings
|
|
|
|
let title = strings.Gift_AuctionTransfer_Title
|
|
let text: String
|
|
if fromPeer.id == context.account.peerId {
|
|
text = strings.Gift_AuctionTransfer_TextFromYourself(toPeer.displayTitle(strings: strings, displayOrder: presentationData.nameDisplayOrder)).string
|
|
} else if toPeer.id == context.account.peerId {
|
|
text = strings.Gift_AuctionTransfer_TextToYourself(fromPeer.displayTitle(strings: strings, displayOrder: presentationData.nameDisplayOrder)).string
|
|
} else {
|
|
text = strings.Gift_AuctionTransfer_Text(fromPeer.displayTitle(strings: strings, displayOrder: presentationData.nameDisplayOrder), toPeer.displayTitle(strings: strings, displayOrder: presentationData.nameDisplayOrder)).string
|
|
}
|
|
|
|
var content: [AnyComponentWithIdentity<AlertComponentEnvironment>] = []
|
|
content.append(AnyComponentWithIdentity(
|
|
id: "header",
|
|
component: AnyComponent(
|
|
AlertTransferHeaderComponent(
|
|
fromComponent: AnyComponentWithIdentity(id: "fromPeer", component: AnyComponent(
|
|
AvatarComponent(
|
|
context: context,
|
|
theme: presentationData.theme,
|
|
peer: fromPeer
|
|
)
|
|
)),
|
|
toComponent: AnyComponentWithIdentity(id: "toPeer", component: AnyComponent(
|
|
AvatarComponent(
|
|
context: context,
|
|
theme: presentationData.theme,
|
|
peer: toPeer
|
|
)
|
|
)),
|
|
type: .transfer
|
|
)
|
|
)
|
|
))
|
|
content.append(AnyComponentWithIdentity(
|
|
id: "title",
|
|
component: AnyComponent(
|
|
AlertTitleComponent(title: title)
|
|
)
|
|
))
|
|
content.append(AnyComponentWithIdentity(
|
|
id: "text",
|
|
component: AnyComponent(
|
|
AlertTextComponent(content: .plain(text))
|
|
)
|
|
))
|
|
|
|
let alertController = AlertScreen(
|
|
context: context,
|
|
configuration: AlertScreen.Configuration(actionAlignment: .vertical, dismissOnOutsideTap: true, allowInputInset: false),
|
|
content: content,
|
|
actions: [
|
|
.init(title: strings.Gift_AuctionTransfer_Change, type: .default, action: {
|
|
commit()
|
|
}),
|
|
.init(title: strings.Common_Cancel)
|
|
]
|
|
)
|
|
return alertController
|
|
}
|