patch settings
This commit is contained in:
parent
b14523a136
commit
692696b937
@ -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" : {
|
||||||
|
|||||||
@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -424,14 +416,14 @@ struct SettingsView: View {
|
|||||||
}
|
}
|
||||||
.padding(.vertical, 4)
|
.padding(.vertical, 4)
|
||||||
}
|
}
|
||||||
|
|
||||||
private func iconBackground<Content: View>(color: Color, @ViewBuilder content: () -> Content) -> some View {
|
private func iconBackground<Content: View>(color: Color, @ViewBuilder content: () -> Content) -> some View {
|
||||||
RoundedRectangle(cornerRadius: 14, style: .continuous)
|
RoundedRectangle(cornerRadius: 14, style: .continuous)
|
||||||
.fill(color)
|
.fill(color)
|
||||||
.frame(width: 44, height: 44)
|
.frame(width: 44, height: 44)
|
||||||
.overlay(content())
|
.overlay(content())
|
||||||
}
|
}
|
||||||
|
|
||||||
private func card<Content: View>(@ViewBuilder content: () -> Content) -> some View {
|
private func card<Content: View>(@ViewBuilder content: () -> Content) -> some View {
|
||||||
VStack(alignment: .leading, spacing: 16) {
|
VStack(alignment: .leading, spacing: 16) {
|
||||||
content()
|
content()
|
||||||
@ -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 {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user