MESSENGER-5706 merge from #5660 and refactoring

This commit is contained in:
JanNiklas Grabowski
2024-03-01 14:06:46 +01:00
parent a37e40b4b8
commit ebcb633892
13 changed files with 130 additions and 134 deletions

View File

@@ -37,6 +37,7 @@ struct DeveloperSettingsView: View {
@State private var showAlertBirthdayCampaign = false
@State private var permalinkPrefix: String? = UserDefaults.standard.string(forKey: "bwi_permalink_prefix")
@State private var showIntroduceFederation = false
@State private var showAnnouncementFederation = false
var body: some View {
Form {
@@ -83,6 +84,23 @@ struct DeveloperSettingsView: View {
}
}
SwiftUI.Section(header: Text(BWIL10n.bwiSettingsDeveloperIntroduceFederation)) {
Button(action: { showAnnouncementFederation = true }) {
Text(BWIL10n.bwiSettingsDeveloperAnnouncementFederationPreview)
.foregroundColor(Color(themeService.theme.tintColor))
.font(.system(size: 17))
}
.sheet(isPresented: $showAnnouncementFederation) {
IntroduceFederationView()
.interactiveDismissDisabled()
.environmentObject(BWIThemeService.shared)
}
if let session = session {
Button(action: { BWIAccountNotificationService(mxSession: session).setShowFederationAnnouncementFlag(true) }) {
Text(BWIL10n.bwiSettingsDeveloperAnnouncementFederationReset)
.foregroundColor(Color(themeService.theme.tintColor))
.font(.system(size: 17))
}
}
Button(action: { showIntroduceFederation = true }) {
Text(BWIL10n.bwiSettingsDeveloperIntroduceFederationPreview)
.foregroundColor(Color(themeService.theme.tintColor))