mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Fixes #367 - Refactor AppSettings usage patterns
This commit is contained in:
committed by
Stefan Ceriu
parent
e5522e7753
commit
98cfc2c9fb
@@ -19,7 +19,6 @@ import SwiftUI
|
||||
struct SettingsScreen: View {
|
||||
@State private var showingLogoutConfirmation = false
|
||||
@Environment(\.colorScheme) private var colorScheme
|
||||
@ObservedObject private var settings = ServiceLocator.shared.settings
|
||||
|
||||
@ScaledMetric private var avatarSize = AvatarSize.user(on: .settings).value
|
||||
@ScaledMetric private var menuIconSize = 30.0
|
||||
@@ -104,13 +103,16 @@ struct SettingsScreen: View {
|
||||
Section {
|
||||
SettingsPickerRow(title: ElementL10n.settingsTimelineStyle,
|
||||
image: Image(systemName: "rectangle.grid.1x2"),
|
||||
selection: $settings.timelineStyle) {
|
||||
selection: $context.timelineStyle) {
|
||||
ForEach(TimelineStyle.allCases, id: \.self) { style in
|
||||
Text(style.description)
|
||||
Text(style.name)
|
||||
.tag(style)
|
||||
}
|
||||
}
|
||||
.accessibilityIdentifier("timelineStylePicker")
|
||||
.onChange(of: context.timelineStyle) { _ in
|
||||
context.send(viewAction: .changedTimelineStyle)
|
||||
}
|
||||
|
||||
SettingsDefaultRow(title: ElementL10n.sendBugReport,
|
||||
image: Image(systemName: "questionmark.circle")) {
|
||||
@@ -166,8 +168,8 @@ struct SettingsScreen: View {
|
||||
}
|
||||
}
|
||||
|
||||
extension TimelineStyle: CustomStringConvertible {
|
||||
var description: String {
|
||||
private extension TimelineStyle {
|
||||
var name: String {
|
||||
switch self {
|
||||
case .plain:
|
||||
return ElementL10n.roomTimelineStylePlainLongDescription
|
||||
|
||||
Reference in New Issue
Block a user