feat: новые функции, исправлены критические ошибки сборки и баги интерфейса, больше подписей в файлах

This commit is contained in:
ichmagmaus 812
2026-03-04 22:06:16 +01:00
parent a614259289
commit f033954db2
81 changed files with 1256 additions and 298 deletions
@@ -232,20 +232,34 @@ final class AffiliateProgramSetupScreenComponent: Component {
)
))
let tableItems: [TableComponent.Item] = [
TableComponent.Item(id: 0, title: environment.strings.AffiliateSetup_AlertApply_SectionCommission, component: AnyComponent(MultilineTextComponent(
text: .plain(NSAttributedString(string: commissionTitle, font: Font.regular(15.0), textColor: environment.theme.actionSheet.primaryTextColor))
))),
TableComponent.Item(id: 1, title: environment.strings.AffiliateSetup_AlertApply_SectionDuration, component: AnyComponent(MultilineTextComponent(
text: .plain(NSAttributedString(string: durationTitle, font: Font.regular(15.0), textColor: environment.theme.actionSheet.primaryTextColor))
)))
]
content.append(AnyComponentWithIdentity(
let textColor = environment.theme.actionSheet.primaryTextColor
let commissionItemText = NSAttributedString(
string: commissionTitle,
font: Font.regular(15.0),
textColor: textColor
)
let durationItemText = NSAttributedString(
string: durationTitle,
font: Font.regular(15.0),
textColor: textColor
)
let commissionItem = TableComponent.Item(
id: 0,
title: environment.strings.AffiliateSetup_AlertApply_SectionCommission,
component: AnyComponent(MultilineTextComponent(text: .plain(commissionItemText)))
)
let durationItem = TableComponent.Item(
id: 1,
title: environment.strings.AffiliateSetup_AlertApply_SectionDuration,
component: AnyComponent(MultilineTextComponent(text: .plain(durationItemText)))
)
let tableItems: [TableComponent.Item] = [commissionItem, durationItem]
let tableComponent = AnyComponent(AlertTableComponent(items: tableItems))
let tableEntry = AnyComponentWithIdentity<AlertComponentEnvironment>(
id: "table",
component: AnyComponent(
AlertTableComponent(items: tableItems)
)
))
component: tableComponent
)
content.append(tableEntry)
let alertController = AlertScreen(
context: component.context,
@@ -6,7 +6,7 @@ import TelegramPresentationData
import MultilineTextComponent
import AlertComponent
final class TableComponent: CombinedComponent {
final class AffiliateTableComponent: CombinedComponent {
class Item: Equatable {
public let id: AnyHashable
public let title: String
@@ -45,7 +45,7 @@ final class TableComponent: CombinedComponent {
self.items = items
}
public static func ==(lhs: TableComponent, rhs: TableComponent) -> Bool {
public static func ==(lhs: AffiliateTableComponent, rhs: AffiliateTableComponent) -> Bool {
if lhs.theme !== rhs.theme {
return false
}
@@ -228,9 +228,9 @@ private final class TableAlertContentComponent: CombinedComponent {
let theme: PresentationTheme
let title: String
let text: String
let table: TableComponent
let table: AffiliateTableComponent
init(theme: PresentationTheme, title: String, text: String, table: TableComponent) {
init(theme: PresentationTheme, title: String, text: String, table: AffiliateTableComponent) {
self.theme = theme
self.title = title
self.text = text
@@ -256,7 +256,7 @@ private final class TableAlertContentComponent: CombinedComponent {
public static var body: Body {
let title = Child(MultilineTextComponent.self)
let text = Child(MultilineTextComponent.self)
let table = Child(TableComponent.self)
let table = Child(AffiliateTableComponent.self)
return { context in
let title = title.update(
@@ -318,17 +318,3 @@ private final class TableAlertContentComponent: CombinedComponent {
}
}
}
func tableAlert(theme: PresentationTheme, title: String, text: String, table: TableComponent, actions: [ComponentAlertAction]) -> ViewController {
return componentAlertController(
theme: AlertControllerTheme(presentationTheme: theme, fontSize: .regular),
content: AnyComponent(TableAlertContentComponent(
theme: theme,
title: title,
text: text,
table: table
)),
actions: actions,
actionLayout: .horizontal
)
}