Various fixes

This commit is contained in:
Ilya Laktyushin
2024-02-12 17:23:30 -04:00
parent 337ae154c9
commit 59c65198de
11 changed files with 128 additions and 63 deletions

View File

@@ -92,10 +92,12 @@ public final class MessageInputPanelComponent: Component {
enum Kind {
case text
case premiumRequired
case boostRequired
}
case text(String)
case premiumRequired(title: String, subtitle: String, action: () -> Void)
case boostRequired(title: String, subtitle: String, action: () -> Void)
var kind: Kind {
switch self {
@@ -103,6 +105,8 @@ public final class MessageInputPanelComponent: Component {
return .text
case .premiumRequired:
return .premiumRequired
case .boostRequired:
return .boostRequired
}
}
@@ -120,6 +124,12 @@ public final class MessageInputPanelComponent: Component {
} else {
return false
}
case let .boostRequired(title, subtitle, _):
if case .boostRequired(title, subtitle, _) = rhs {
return true
} else {
return false
}
}
}
}
@@ -1093,7 +1103,7 @@ public final class MessageInputPanelComponent: Component {
contents = AnyComponent(MultilineTextComponent(
text: .plain(NSAttributedString(string: text, font: Font.regular(17.0), textColor: UIColor(rgb: 0xffffff, alpha: 0.3)))
))
case let .premiumRequired(title, subtitle, action):
case let .premiumRequired(title, subtitle, action), let .boostRequired(title, subtitle, action):
leftAlignment = true
contents = AnyComponent(PlainButtonComponent(
content: AnyComponent(VStack([