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" : { "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" : { "localizations" : {
"en" : { "en" : {
"stringUnit" : { "stringUnit" : {

View File

@ -169,7 +169,7 @@ struct SettingsView: View {
displayName: messengerDisplayName(for: profile), displayName: messengerDisplayName(for: profile),
presenceStatus: nil, presenceStatus: nil,
statusTags: messengerStatusTags(for: profile), statusTags: messengerStatusTags(for: profile),
isOfficial: self.messengerProfile?.isVerified ?? false isOfficial: profile.isVerified
) )
.listRowInsets(EdgeInsets(top: 16, leading: 0, bottom: 8, trailing: 0)) .listRowInsets(EdgeInsets(top: 16, leading: 0, bottom: 8, trailing: 0))
.listRowBackground(Color.clear) .listRowBackground(Color.clear)
@ -362,42 +362,34 @@ struct SettingsView: View {
return formatter return formatter
}() }()
@ViewBuilder
private var aboutSection: some View { private var aboutSection: some View {
if messengerProfile != nil || isMessengerProfileLoading || messengerProfileError != nil { if let _ = messengerProfile {
Section { Section() {
card { card {
VStack(spacing: 0) { VStack(spacing: 0) {
if let login = loginDisplay {
infoRow(
title: NSLocalizedString("Юзернейм", comment: ""),
value: login
)
}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( infoRow(
title: NSLocalizedString("Ваш рейтинг", comment: "Message profile rating title"), title: NSLocalizedString("Юзернейм", comment: ""),
value: ratingDisplayValue value: loginDisplay ?? NSLocalizedString("Неизвестный пользователь", comment: "Messenger settings unknown user")
) )
// 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)) .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 { private struct LegacySupportBanner: View {