mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 20:39:24 +00:00
Move where the developer options are shown and store them in the app settings.
This commit is contained in:
committed by
Stefan Ceriu
parent
eaa6dd9240
commit
0c5be93a75
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user