mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-08-28 20:08:16 +00:00
ui
This commit is contained in:
@@ -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? {
|
||||
|
||||
Reference in New Issue
Block a user