diff --git a/Passepartout/Library/Sources/AppUI/Views/About/LinksView.swift b/Passepartout/Library/Sources/AppUI/Views/About/LinksView.swift index e5f05328..584a37c4 100644 --- a/Passepartout/Library/Sources/AppUI/Views/About/LinksView.swift +++ b/Passepartout/Library/Sources/AppUI/Views/About/LinksView.swift @@ -48,23 +48,21 @@ private extension LinksView { } var supportSection: some View { - Section { + Group { Link(Strings.Views.About.Links.Rows.joinCommunity, destination: constants.websites.subreddit) Link(Strings.Views.About.Links.Rows.writeReview, destination: BundleConfiguration.urlForReview) - } header: { - Text(Strings.Views.About.Links.Sections.support) } + .themeSection(header: Strings.Views.About.Links.Sections.support) } var webSection: some View { - Section { + Group { Link(Strings.Views.About.Links.Rows.homePage, destination: constants.websites.home) Link(Strings.Unlocalized.faq, destination: constants.websites.faq) Link(Strings.Views.About.Links.Rows.disclaimer, destination: constants.websites.disclaimer) Link(Strings.Views.About.Links.Rows.privacyPolicy, destination: constants.websites.privacyPolicy) - } header: { - Text(Strings.Views.About.Links.Sections.web) } + .themeSection(header: Strings.Views.About.Links.Sections.web) } } diff --git a/Passepartout/Library/Sources/AppUI/Views/About/iOS/AboutView+iOS.swift b/Passepartout/Library/Sources/AppUI/Views/About/iOS/AboutView+iOS.swift index 27c92f93..3b25bace 100644 --- a/Passepartout/Library/Sources/AppUI/Views/About/iOS/AboutView+iOS.swift +++ b/Passepartout/Library/Sources/AppUI/Views/About/iOS/AboutView+iOS.swift @@ -32,14 +32,13 @@ extension AboutView { var listView: some View { List { SettingsSectionGroup(profileManager: profileManager) - Section { + Group { // TODO: #585, donations // donateLink linksLink creditsLink - } header: { - Text(Strings.Views.About.Sections.resources) } + .themeSection(header: Strings.Views.About.Sections.resources) Section { diagnosticsLink Text(Strings.Global.version) diff --git a/Passepartout/Library/Sources/AppUI/Views/App/ProfileListView.swift b/Passepartout/Library/Sources/AppUI/Views/App/ProfileListView.swift index d040dd52..12fb0976 100644 --- a/Passepartout/Library/Sources/AppUI/Views/App/ProfileListView.swift +++ b/Passepartout/Library/Sources/AppUI/Views/App/ProfileListView.swift @@ -55,12 +55,11 @@ struct ProfileListView: View, ProfileManagerProviding, TunnelInstallationProvidi if !isSearching { headerView(scrollProxy: scrollProxy) } - Section { + Group { ForEach(allHeaders, content: profileView) .onDelete(perform: removeProfiles) - } header: { - Text(Strings.Views.Profiles.Folders.default) } + .themeSection(header: Strings.Views.Profiles.Folders.default) } .themeForm() } diff --git a/Passepartout/Library/Sources/AppUI/Views/Diagnostics/DiagnosticsView.swift b/Passepartout/Library/Sources/AppUI/Views/Diagnostics/DiagnosticsView.swift index 9559c84b..841a1821 100644 --- a/Passepartout/Library/Sources/AppUI/Views/Diagnostics/DiagnosticsView.swift +++ b/Passepartout/Library/Sources/AppUI/Views/Diagnostics/DiagnosticsView.swift @@ -98,7 +98,7 @@ struct DiagnosticsView: View { private extension DiagnosticsView { var liveLogSection: some View { - Section { + Group { navLink(Strings.Views.Diagnostics.Rows.app, to: .appDebugLog(title: Strings.Views.Diagnostics.Rows.app)) navLink(Strings.Views.Diagnostics.Rows.tunnel, to: .tunnelDebugLog(title: Strings.Views.Diagnostics.Rows.tunnel, url: nil)) @@ -107,13 +107,12 @@ private extension DiagnosticsView { PassepartoutConfiguration.shared.logsAddresses = $0 PassepartoutConfiguration.shared.logsModules = $0 } - } header: { - Text(Strings.Views.Diagnostics.Sections.live) } + .themeSection(header: Strings.Views.Diagnostics.Sections.live) } var tunnelLogsSection: some View { - Section { + Group { Button(Strings.Views.Diagnostics.Rows.removeTunnelLogs) { withAnimation(theme.animation(for: .diagnostics), removeTunnelLogs) } @@ -121,23 +120,21 @@ private extension DiagnosticsView { ForEach(tunnelLogs, id: \.date, content: logView) .onDelete(perform: removeTunnelLogs) - } header: { - Text(Strings.Views.Diagnostics.Sections.tunnel) } + .themeSection(header: Strings.Views.Diagnostics.Sections.tunnel) .themeAnimation(on: tunnelLogs, category: .diagnostics) } var openVPNSection: some View { connectionObserver.value(forKey: TunnelEnvironmentKeys.OpenVPN.serverConfiguration) .map { cfg in - Section { + Group { NavigationLink(Strings.Views.Diagnostics.Openvpn.Rows.serverConfiguration) { OpenVPNView(serverConfiguration: cfg) .navigationTitle(Strings.Views.Diagnostics.Openvpn.Rows.serverConfiguration) } - } header: { - Text(Strings.Unlocalized.openVPN) } + .themeSection(header: Strings.Unlocalized.openVPN) } } diff --git a/Passepartout/Library/Sources/AppUI/Views/Modules/DNSView.swift b/Passepartout/Library/Sources/AppUI/Views/Modules/DNSView.swift index aba7ebc0..6c6a9bc8 100644 --- a/Passepartout/Library/Sources/AppUI/Views/Modules/DNSView.swift +++ b/Passepartout/Library/Sources/AppUI/Views/Modules/DNSView.swift @@ -96,11 +96,10 @@ private extension DNSView { } var domainSection: some View { - Section { + Group { ThemeTextField(Strings.Global.domain, text: $draft.domainName ?? "", placeholder: Strings.Unlocalized.Placeholders.hostname) - } header: { - Text(Strings.Global.domain) } + .themeSection(header: Strings.Global.domain) } var serversSection: some View { diff --git a/Passepartout/Library/Sources/AppUI/Views/Modules/HTTPProxyView.swift b/Passepartout/Library/Sources/AppUI/Views/Modules/HTTPProxyView.swift index ac0fb51a..5fdcccd0 100644 --- a/Passepartout/Library/Sources/AppUI/Views/Modules/HTTPProxyView.swift +++ b/Passepartout/Library/Sources/AppUI/Views/Modules/HTTPProxyView.swift @@ -64,29 +64,26 @@ private struct HTTPProxyView: View { private extension HTTPProxyView { var httpSection: some View { - Section { + Group { ThemeTextField(Strings.Global.address, text: $draft.address, placeholder: Strings.Unlocalized.Placeholders.proxyIPv4Address) ThemeTextField(Strings.Global.port, text: $draft.port.toString(omittingZero: true), placeholder: Strings.Unlocalized.Placeholders.proxyPort) - } header: { - Text(Strings.Unlocalized.http) } + .themeSection(header: Strings.Unlocalized.http) } var httpsSection: some View { - Section { + Group { ThemeTextField(Strings.Global.address, text: $draft.secureAddress, placeholder: Strings.Unlocalized.Placeholders.proxyIPv4Address) ThemeTextField(Strings.Global.port, text: $draft.securePort.toString(omittingZero: true), placeholder: Strings.Unlocalized.Placeholders.proxyPort) - } header: { - Text(Strings.Unlocalized.https) } + .themeSection(header: Strings.Unlocalized.https) } var pacSection: some View { - Section { + Group { ThemeTextField(Strings.Unlocalized.url, text: $draft.pacURLString, placeholder: Strings.Unlocalized.Placeholders.pacURL) - } header: { - Text(Strings.Unlocalized.pac) } + .themeSection(header: Strings.Unlocalized.pac) } @ViewBuilder diff --git a/Passepartout/Library/Sources/AppUI/Views/Modules/IPView.swift b/Passepartout/Library/Sources/AppUI/Views/Modules/IPView.swift index d4eb5956..24b7a5fc 100644 --- a/Passepartout/Library/Sources/AppUI/Views/Modules/IPView.swift +++ b/Passepartout/Library/Sources/AppUI/Views/Modules/IPView.swift @@ -137,7 +137,7 @@ private extension IPView { } var interfaceSection: some View { - Section { + Group { ThemeTextField( Strings.Unlocalized.mtu, text: Binding { @@ -147,9 +147,8 @@ private extension IPView { }, placeholder: Strings.Unlocalized.Placeholders.mtu ) - } header: { - Text(Strings.Global.interface) } + .themeSection(header: Strings.Global.interface) } } diff --git a/Passepartout/Library/Sources/AppUI/Views/Modules/OnDemandView.swift b/Passepartout/Library/Sources/AppUI/Views/Modules/OnDemandView.swift index 84813d15..439fe610 100644 --- a/Passepartout/Library/Sources/AppUI/Views/Modules/OnDemandView.swift +++ b/Passepartout/Library/Sources/AppUI/Views/Modules/OnDemandView.swift @@ -136,15 +136,14 @@ private extension OnDemandView { } var networkSection: some View { - Section { + Group { if Utils.hasCellularData() { Toggle(Strings.Modules.OnDemand.mobile, isOn: $draft.withMobileNetwork) } else if Utils.hasEthernet() { Toggle(Strings.Modules.OnDemand.ethernet, isOn: $draft.withEthernetNetwork) } - } header: { - Text(Strings.Global.networks) } + .themeSection(header: Strings.Global.networks) } var wifiSection: some View { diff --git a/Passepartout/Library/Sources/AppUI/Views/Profile/iOS/ProfileEditView+iOS.swift b/Passepartout/Library/Sources/AppUI/Views/Profile/iOS/ProfileEditView+iOS.swift index 0df60d86..6781b66c 100644 --- a/Passepartout/Library/Sources/AppUI/Views/Profile/iOS/ProfileEditView+iOS.swift +++ b/Passepartout/Library/Sources/AppUI/Views/Profile/iOS/ProfileEditView+iOS.swift @@ -52,17 +52,17 @@ struct ProfileEditView: View, Routable { name: $profileEditor.name, placeholder: Strings.Placeholders.Profile.name ) - Section { + Group { ForEach(profileEditor.modules, id: \.id, content: moduleRow) .onMove(perform: moveModules) .onDelete(perform: removeModules) addModuleButton - } header: { - Text(Strings.Global.modules) - } footer: { - Text(Strings.Views.Profile.ModuleList.Section.footer) } + .themeSection( + header: Strings.Global.modules, + footer: Strings.Views.Profile.ModuleList.Section.footer + ) StorageSection( profileEditor: profileEditor ) diff --git a/Passepartout/Library/Sources/AppUI/Views/ProfileEditor/ModuleSection.swift b/Passepartout/Library/Sources/AppUI/Views/ProfileEditor/ModuleSection.swift index 37043431..84698e51 100644 --- a/Passepartout/Library/Sources/AppUI/Views/ProfileEditor/ModuleSection.swift +++ b/Passepartout/Library/Sources/AppUI/Views/ProfileEditor/ModuleSection.swift @@ -79,11 +79,10 @@ extension Collection { extension View { func moduleSection(for rows: [ModuleRow]?, header: String) -> some View { rows.map { rows in - Section { + Group { ForEach(rows, id: \.self, content: moduleRowView) - } header: { - Text(header) } + .themeSection(header: header) } } } diff --git a/Passepartout/Library/Sources/AppUI/Views/Settings/SettingsSectionGroup.swift b/Passepartout/Library/Sources/AppUI/Views/Settings/SettingsSectionGroup.swift index 71ba50f0..a102b201 100644 --- a/Passepartout/Library/Sources/AppUI/Views/Settings/SettingsSectionGroup.swift +++ b/Passepartout/Library/Sources/AppUI/Views/Settings/SettingsSectionGroup.swift @@ -46,16 +46,15 @@ struct SettingsSectionGroup: View { private var isErasingiCloud = false var body: some View { - Section { + Group { #if os(macOS) confirmsQuitToggle #endif #if os(iOS) lockInBackgroundToggle #endif - } header: { - Text(Strings.Global.general) } + .themeSection(header: Strings.Global.general) Group { eraseCloudKitButton } diff --git a/Passepartout/Library/Sources/AppUI/Views/UI/NameSection.swift b/Passepartout/Library/Sources/AppUI/Views/UI/NameSection.swift index 36c5a2bf..217d8c9c 100644 --- a/Passepartout/Library/Sources/AppUI/Views/UI/NameSection.swift +++ b/Passepartout/Library/Sources/AppUI/Views/UI/NameSection.swift @@ -34,13 +34,12 @@ struct NameSection: View { var body: some View { debugChanges() - return Section { + return Group { ThemeTextField(Strings.Global.name, text: $name, placeholder: placeholder) .labelsHidden() .themeManualInput() - } header: { - Text(Strings.Global.name) } + .themeSection(header: Strings.Global.name) } }