This commit is contained in:
spaced4ndy
2025-07-18 13:02:30 +04:00
parent 1ed0bc69c1
commit 8f082d9529
+22
View File
@@ -811,6 +811,7 @@ struct ChatView: View {
}
struct ChatBannerView: View {
@EnvironmentObject var theme: AppTheme
@Environment(\.dynamicTypeSize) private var userFont: DynamicTypeSize
@UserDefault(DEFAULT_TOOLBAR_MATERIAL) private var toolbarMaterial = ToolbarMaterial.defaultMaterial
@ObservedObject var chat: Chat
@@ -844,6 +845,14 @@ struct ChatView: View {
.fixedSize(horizontal: false, vertical: true)
.padding(.horizontal)
}
if let chatContext = chatContext() {
Spacer().frame(height: 0)
Label(chatContext, systemImage: "info.circle")
.font(.subheadline)
.foregroundColor(theme.colors.secondary)
}
}
.frame(maxWidth: .infinity)
.padding()
@@ -857,6 +866,19 @@ struct ChatView: View {
Spacer().frame(height: 60)
}
}
func chatContext() -> String? {
switch chat.chatInfo {
case .direct: NSLocalizedString("Contact", comment: "chat context")
case let .group(groupInfo, _):
switch groupInfo.businessChat?.chatType {
case .none: NSLocalizedString("Group", comment: "chat context")
case .business: NSLocalizedString("Business", comment: "chat context")
case .customer: NSLocalizedString("Client", comment: "chat context")
}
default: nil
}
}
}
private var connectingText: LocalizedStringKey? {