Compare commits

..

No commits in common. "c9bfab0b1446e9071caf9c38999ae7767597522b" and "342da3b773ce09e50368fc756a88e69facfe0820" have entirely different histories.

2 changed files with 16 additions and 66 deletions

View File

@ -1053,14 +1053,7 @@
},
"Неизвестный пользователь" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Unknown User"
}
}
}
},
"Некорректный ответ от сервера." : {

View File

@ -640,24 +640,12 @@ private struct ChatRowView: View {
officialFullName != nil
}
private var isDeletedUser: Bool {
guard chat.chatType != .self else { return false }
let login = chat.chatData?.login?.trimmingCharacters(in: .whitespacesAndNewlines)
return login?.isEmpty ?? true
}
private var avatarBackgroundColor: Color {
if isDeletedUser {
return Color(.systemGray5)
}
return isOfficial ? Color.accentColor.opacity(0.85) : Color.accentColor.opacity(0.15)
isOfficial ? Color.accentColor.opacity(0.85) : Color.accentColor.opacity(0.15)
}
private var avatarTextColor: Color {
if isDeletedUser {
return Color.accentColor
}
return isOfficial ? Color.white : Color.accentColor
isOfficial ? Color.white : Color.accentColor
}
private var messagePreview: String {
@ -754,10 +742,6 @@ private struct ChatRowView: View {
return "?"
}
private var deletedUserSymbolName: String {
return "person.slash"
}
private var subtitleColor: Color {
chat.unreadCount > 0 ? .primary : .secondary
}
@ -784,37 +768,19 @@ private struct ChatRowView: View {
.fill(avatarBackgroundColor)
.frame(width: 44, height: 44)
.overlay(
Group {
if isDeletedUser {
Image(systemName: deletedUserSymbolName)
.symbolRenderingMode(.hierarchical)
.font(.system(size: 20, weight: .semibold))
.foregroundColor(avatarTextColor)
} else {
Text(initial)
.font(.headline)
.foregroundColor(avatarTextColor)
}
}
Text(initial)
.font(.headline)
.foregroundColor(avatarTextColor)
)
VStack(alignment: .leading, spacing: 4) {
if let officialName = officialFullName {
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)
}
Text(officialName)
.fontWeight(.semibold)
.foregroundColor(.primary)
.lineLimit(1)
.truncationMode(.tail)
Image(systemName: "checkmark.seal.fill")
.foregroundColor(Color.accentColor)
@ -829,20 +795,11 @@ private struct ChatRowView: View {
// .truncationMode(.tail)
// }
} 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)
}
Text(title)
.fontWeight(chat.unreadCount > 0 ? .semibold : .regular)
.foregroundColor(.primary)
.lineLimit(1)
.truncationMode(.tail)
}
Text(messagePreview)