style in progress

This commit is contained in:
spaced4ndy
2025-07-18 11:44:25 +04:00
parent 8a4308278a
commit af8716c2eb
+41 -18
View File
@@ -732,7 +732,7 @@ struct ChatView: View {
}
return Group {
if case .chatBanner = ci.content {
chatBannerView()
ChatBannerView(chat: chat)
} else {
let voiceNoFrame = voiceWithoutFrame(ci)
let maxWidth = cInfo.chatType == .group
@@ -810,26 +810,49 @@ struct ChatView: View {
}
}
private func chatBannerView() -> some View {
VStack {
Spacer().frame(height: 60)
struct ChatBannerView: View {
@Environment(\.dynamicTypeSize) private var userFont: DynamicTypeSize
@ObservedObject var chat: Chat
ChatInfoImage(chat: chat, size: 103, backgroundColor: theme.colors.background)
Text(chat.chatInfo.chatViewName)
.font(.title3)
.multilineTextAlignment(.center)
.lineLimit(2)
let fullName = chat.chatInfo.fullName.trimmingCharacters(in: .whitespacesAndNewlines)
if fullName != "" && fullName != chat.chatInfo.chatViewName && fullName != chat.chatInfo.chatViewName.trimmingCharacters(in: .whitespacesAndNewlines) {
Text(chat.chatInfo.fullName)
.font(.headline)
.multilineTextAlignment(.center)
.lineLimit(3)
var body: some View {
VStack {
Spacer().frame(height: 60)
VStack(spacing: 8) {
ChatInfoImage(chat: chat, size: dynamicSize(userFont).profileImageSize)
Text(chat.chatInfo.displayName)
.font(.title3)
.multilineTextAlignment(.center)
.lineLimit(2)
.frame(maxWidth: 240)
let fullName = chat.chatInfo.fullName.trimmingCharacters(in: .whitespacesAndNewlines)
if fullName != "" && fullName != chat.chatInfo.displayName && fullName != chat.chatInfo.displayName.trimmingCharacters(in: .whitespacesAndNewlines) {
Text(chat.chatInfo.fullName)
.font(.headline)
.fontWeight(.regular)
.multilineTextAlignment(.center)
.lineLimit(2)
.frame(maxWidth: 260)
}
if let shortDescr = chat.chatInfo.shortDescr {
Text(shortDescr)
.font(.subheadline)
.multilineTextAlignment(.center)
.lineLimit(3)
.padding(.horizontal)
}
}
.frame(maxWidth: .infinity)
.padding()
.background(
RoundedRectangle(cornerRadius: 18)
.fill(Color(uiColor: .tertiarySystemGroupedBackground))
)
.padding(.horizontal)
Spacer().frame(height: 60)
}
Spacer().frame(height: 60)
}
.frame(maxWidth: 160)
}
private var connectingText: LocalizedStringKey? {