From d85921e9fe3b08c58bfc94f89c5974052fcf7dc4 Mon Sep 17 00:00:00 2001 From: cheykrym Date: Sat, 13 Dec 2025 03:07:06 +0300 Subject: [PATCH] patch msg display --- yobble/Resources/Localizable.xcstrings | 1 + yobble/Views/Tab/ChatsTab.swift | 146 +++++++++++++++---------- 2 files changed, 90 insertions(+), 57 deletions(-) diff --git a/yobble/Resources/Localizable.xcstrings b/yobble/Resources/Localizable.xcstrings index bf8feb9..7d39802 100644 --- a/yobble/Resources/Localizable.xcstrings +++ b/yobble/Resources/Localizable.xcstrings @@ -963,6 +963,7 @@ "comment" : "Contacts empty state title" }, "Контакты" : { + "comment" : "Contacts tab title", "localizations" : { "en" : { "stringUnit" : { diff --git a/yobble/Views/Tab/ChatsTab.swift b/yobble/Views/Tab/ChatsTab.swift index 866cbb9..9815d48 100644 --- a/yobble/Views/Tab/ChatsTab.swift +++ b/yobble/Views/Tab/ChatsTab.swift @@ -1044,80 +1044,112 @@ private struct ChatRowView: View { } VStack(alignment: .leading, spacing: 4) { - if let officialName = officialDisplayName { - HStack(spacing: 6) { + HStack{ + if let officialName = officialDisplayName { + HStack(spacing: 6) { + if #available(iOS 16.0, *) { + Text(officialName) + .fontWeight(.semibold) + .foregroundColor(.primary) + .lineLimit(1) + .truncationMode(.tail) + .strikethrough(isDeletedUser, color: Color.secondary) + } else { + Text(officialName) + .fontWeight(.semibold) + .foregroundColor(.primary) + .lineLimit(1) + .truncationMode(.tail) + } + + Image(systemName: "checkmark.seal.fill") + .foregroundColor(Color.accentColor) + .font(.caption) + } + } else { if #available(iOS 16.0, *) { - Text(officialName) - .fontWeight(.semibold) + Text(title) + .fontWeight(chat.unreadCount > 0 ? .semibold : .regular) .foregroundColor(.primary) .lineLimit(1) .truncationMode(.tail) .strikethrough(isDeletedUser, color: Color.secondary) } else { - Text(officialName) - .fontWeight(.semibold) + Text(title) + .fontWeight(chat.unreadCount > 0 ? .semibold : .regular) .foregroundColor(.primary) .lineLimit(1) .truncationMode(.tail) } - - Image(systemName: "checkmark.seal.fill") - .foregroundColor(Color.accentColor) - .font(.caption) } - } else { - if #available(iOS 16.0, *) { - Text(title) - .fontWeight(chat.unreadCount > 0 ? .semibold : .regular) - .foregroundColor(.primary) - .lineLimit(1) - .truncationMode(.tail) - .strikethrough(isDeletedUser, color: Color.secondary) - } else { - Text(title) - .fontWeight(chat.unreadCount > 0 ? .semibold : .regular) - .foregroundColor(.primary) - .lineLimit(1) - .truncationMode(.tail) + + if let timestamp { + Spacer() + HStack(spacing: 4) { + if shouldShowReadStatus { + Image(systemName: readStatusIconName) + .foregroundColor(readStatusColor) + .font(.caption2) + } + + Text(timestamp) + .font(.caption) + .foregroundColor(.secondary) + } + } + + } + + HStack { + Text(messagePreview) + .font(.subheadline) + .foregroundColor(subtitleColor) + .lineLimit(messageLimitLine) + .truncationMode(.tail) + + if chat.unreadCount > 0 { + Spacer() + Text("\(chat.unreadCount)") + .font(.caption2.bold()) + .foregroundColor(.white) + .padding(.horizontal, 8) + .padding(.vertical, 4) + .background( + Capsule().fill(Color.accentColor) + ) } } - - Text(messagePreview) - .font(.subheadline) - .foregroundColor(subtitleColor) - .lineLimit(messageLimitLine) - .truncationMode(.tail) } .frame(maxWidth: .infinity, alignment: .leading) - Spacer() +// Spacer() - VStack(alignment: .trailing, spacing: 6) { - if let timestamp { - HStack(spacing: 4) { - if shouldShowReadStatus { - Image(systemName: readStatusIconName) - .foregroundColor(readStatusColor) - .font(.caption2) - } - - Text(timestamp) - .font(.caption) - .foregroundColor(.secondary) - } - } - - if chat.unreadCount > 0 { - Text("\(chat.unreadCount)") - .font(.caption2.bold()) - .foregroundColor(.white) - .padding(.horizontal, 8) - .padding(.vertical, 4) - .background( - Capsule().fill(Color.accentColor) - ) - } - } +// VStack(alignment: .trailing, spacing: 6) { +//// if let timestamp { +//// HStack(spacing: 4) { +//// if shouldShowReadStatus { +//// Image(systemName: readStatusIconName) +//// .foregroundColor(readStatusColor) +//// .font(.caption2) +//// } +//// +//// Text(timestamp) +//// .font(.caption) +//// .foregroundColor(.secondary) +//// } +//// } +// +// if chat.unreadCount > 0 { +// Text("\(chat.unreadCount)") +// .font(.caption2.bold()) +// .foregroundColor(.white) +// .padding(.horizontal, 8) +// .padding(.vertical, 4) +// .background( +// Capsule().fill(Color.accentColor) +// ) +// } +// } } .padding(.vertical, 8) }