Move where the developer options are shown and store them in the app settings.

This commit is contained in:
Stefan Ceriu
2025-04-30 14:01:28 +03:00
committed by Stefan Ceriu
parent eaa6dd9240
commit 0c5be93a75
11 changed files with 65 additions and 39 deletions
@@ -31,6 +31,10 @@ struct SettingsScreen: View {
generalSection
signOutSection
if context.viewState.showDeveloperOptions {
developerOptionsSection
}
}
.compoundList()
.navigationTitle(L10n.commonSettings)
@@ -164,15 +168,6 @@ struct SettingsScreen: View {
context.send(viewAction: .advancedSettings)
})
.accessibilityIdentifier(A11yIdentifiers.settingsScreen.advancedSettings)
if context.viewState.showDeveloperOptions {
ListRow(label: .default(title: L10n.commonDeveloperOptions,
icon: \.code),
kind: .navigationLink {
context.send(viewAction: .developerOptions)
})
.accessibilityIdentifier(A11yIdentifiers.settingsScreen.developerOptions)
}
}
}
@@ -195,21 +190,40 @@ struct SettingsScreen: View {
})
}
} footer: {
VStack(spacing: 0) {
versionText
.frame(maxWidth: .infinity)
if let deviceID = context.viewState.deviceID {
Text(deviceID)
}
if !context.viewState.showDeveloperOptions {
versionSection
}
.compoundListSectionFooter()
.textSelection(.enabled)
.padding(.top, 24)
.onTapGesture(count: 7) {
context.send(viewAction: .enableDeveloperOptions)
}
}
private var developerOptionsSection: some View {
Section {
ListRow(label: .default(title: L10n.commonDeveloperOptions,
icon: \.code),
kind: .navigationLink {
context.send(viewAction: .developerOptions)
})
.accessibilityIdentifier(A11yIdentifiers.settingsScreen.developerOptions)
} footer: {
versionSection
}
}
private var versionSection: some View {
VStack(spacing: 0) {
versionText
.frame(maxWidth: .infinity)
if let deviceID = context.viewState.deviceID {
Text(deviceID)
}
}
.compoundListSectionFooter()
.textSelection(.enabled)
.padding(.top, 24)
.onTapGesture(count: 7) {
context.send(viewAction: .enableDeveloperOptions)
}
}
private var versionText: Text {