patch settings

This commit is contained in:
cheykrym 2025-12-13 01:28:51 +03:00
parent b14523a136
commit 692696b937
2 changed files with 50 additions and 34 deletions

View File

@ -320,6 +320,9 @@
}
}
},
"Ваш рейтинг" : {
"comment" : "Messenger settings rating title"
},
"Введите код" : {
},
@ -1600,7 +1603,7 @@
}
},
"Недоступно" : {
"comment" : "Message profile rating unavailable"
"comment" : "Message profile rating unavailable\nMessenger settings rating unavailable"
},
"Неизвестная ошибка" : {
"localizations" : {
@ -1633,7 +1636,7 @@
}
},
"Неизвестный пользователь" : {
"comment" : "Deleted user display name\nMessage profile fallback title\nUnknown chat title",
"comment" : "Deleted user display name\nMessage profile fallback title\nMessenger settings unknown user\nUnknown chat title",
"localizations" : {
"en" : {
"stringUnit" : {

View File

@ -169,7 +169,7 @@ struct SettingsView: View {
displayName: messengerDisplayName(for: profile),
presenceStatus: nil,
statusTags: messengerStatusTags(for: profile),
isOfficial: self.messengerProfile?.isVerified ?? false
isOfficial: profile.isVerified
)
.listRowInsets(EdgeInsets(top: 16, leading: 0, bottom: 8, trailing: 0))
.listRowBackground(Color.clear)
@ -362,42 +362,34 @@ struct SettingsView: View {
return formatter
}()
@ViewBuilder
private var aboutSection: some View {
if messengerProfile != nil || isMessengerProfileLoading || messengerProfileError != nil {
Section {
if let _ = messengerProfile {
Section() {
card {
VStack(spacing: 0) {
if let login = loginDisplay {
infoRow(
title: NSLocalizedString("Юзернейм", comment: ""),
value: login
value: loginDisplay ?? NSLocalizedString("Неизвестный пользователь", comment: "Messenger settings unknown user")
)
}else{
infoRow(
title: NSLocalizedString("Юзернейм", comment: ""),
value: "Неизвестный пользователь"
)
}
if let membership = membershipDescription {
rowDivider
infoRow(
title: NSLocalizedString("Дата регистрации в Yobble", comment: ""),
value: membership
)
}
if loginDisplay != nil || membershipDescription != nil {
rowDivider
}
infoRow(
title: NSLocalizedString("Ваш рейтинг", comment: "Message profile rating title"),
value: ratingDisplayValue
)
// if let membership = membershipDescription {
// rowDivider
// infoRow(
// title: NSLocalizedString("Дата регистрации в Yobble", comment: ""),
// value: membership
// )
// }
//
// rowDivider
// infoRow(
// title: NSLocalizedString("Ваш рейтинг", comment: "Messenger settings rating title"),
// value: ratingDisplayValue
// )
}
}
.listRowInsets(EdgeInsets(top: 8, leading: 0, bottom: 8, trailing: 0))
.listRowBackground(Color.clear)
}
}
}
@ -443,6 +435,27 @@ struct SettingsView: View {
.fill(Color(UIColor.secondarySystemGroupedBackground))
)
}
private var rowDivider: some View {
Divider()
.padding(.vertical, 12)
}
private var loginDisplay: String? {
let login = messengerProfile?.login.trimmingCharacters(in: .whitespacesAndNewlines) ?? ""
guard !login.isEmpty else { return nil }
return "@\(login)"
}
private var membershipDescription: String? {
guard let createdAt = messengerProfile?.createdAt else { return nil }
let formatted = SettingsView.membershipFormatter.string(from: createdAt)
return formatted
}
private var ratingDisplayValue: String {
NSLocalizedString("Недоступно", comment: "Messenger settings rating unavailable")
}
}
private struct LegacySupportBanner: View {