From 1d2de39d498fbd9d6ea5f48a04e0b2aebf09712f Mon Sep 17 00:00:00 2001 From: Davide Date: Sun, 3 Nov 2024 11:44:14 +0100 Subject: [PATCH] Use profile name as interactive view title --- .../Sources/UILibrary/L10n/SwiftGen+Strings.swift | 4 ---- .../UILibrary/Resources/en.lproj/Localizable.strings | 1 - .../UILibrary/Views/UI/InteractiveCoordinator.swift | 11 +++++++++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Passepartout/Library/Sources/UILibrary/L10n/SwiftGen+Strings.swift b/Passepartout/Library/Sources/UILibrary/L10n/SwiftGen+Strings.swift index 03e8870a..0e2ec97b 100644 --- a/Passepartout/Library/Sources/UILibrary/L10n/SwiftGen+Strings.swift +++ b/Passepartout/Library/Sources/UILibrary/L10n/SwiftGen+Strings.swift @@ -531,10 +531,6 @@ public enum Strings { /// (on-demand) public static let onDemandSuffix = Strings.tr("Localizable", "ui.connection_status.on_demand_suffix", fallback: " (on-demand)") } - public enum InteractiveCoordinator { - /// Interactive - public static let title = Strings.tr("Localizable", "ui.interactive_coordinator.title", fallback: "Interactive") - } public enum ProfileContext { /// Connect to... public static let connectTo = Strings.tr("Localizable", "ui.profile_context.connect_to", fallback: "Connect to...") diff --git a/Passepartout/Library/Sources/UILibrary/Resources/en.lproj/Localizable.strings b/Passepartout/Library/Sources/UILibrary/Resources/en.lproj/Localizable.strings index c8a4234a..e93d9abd 100644 --- a/Passepartout/Library/Sources/UILibrary/Resources/en.lproj/Localizable.strings +++ b/Passepartout/Library/Sources/UILibrary/Resources/en.lproj/Localizable.strings @@ -246,7 +246,6 @@ // MARK: - Components "ui.connection_status.on_demand_suffix" = " (on-demand)"; -"ui.interactive_coordinator.title" = "Interactive"; "ui.profile_context.connect_to" = "Connect to..."; // MARK: - Paywalls diff --git a/Passepartout/Library/Sources/UILibrary/Views/UI/InteractiveCoordinator.swift b/Passepartout/Library/Sources/UILibrary/Views/UI/InteractiveCoordinator.swift index 10e2fbee..b78685c9 100644 --- a/Passepartout/Library/Sources/UILibrary/Views/UI/InteractiveCoordinator.swift +++ b/Passepartout/Library/Sources/UILibrary/Views/UI/InteractiveCoordinator.swift @@ -52,6 +52,7 @@ public struct InteractiveCoordinator: View { case .modal: interactiveView .modifier(ModalInteractiveModifier( + title: title, confirm: confirm, cancel: cancel )) @@ -59,7 +60,7 @@ public struct InteractiveCoordinator: View { case .inline(let withCancel): interactiveView .modifier(InlineInteractiveModifier( - title: manager.editor.profile.name, + title: title, withCancel: withCancel, confirm: confirm, cancel: cancel @@ -72,6 +73,8 @@ public struct InteractiveCoordinator: View { private extension InteractiveCoordinator { struct ModalInteractiveModifier: ViewModifier { + let title: String + let confirm: () -> Void let cancel: () -> Void @@ -83,7 +86,7 @@ private extension InteractiveCoordinator { } .themeForm() .themeNavigationDetail() - .navigationTitle(Strings.Ui.InteractiveCoordinator.title) + .navigationTitle(title) .toolbar(content: modalToolbar) } } @@ -166,6 +169,10 @@ private extension InteractiveCoordinator { AnyView(provider.interactiveView(with: manager.editor, onSubmit: confirm)) } + var title: String { + manager.editor.profile.name + } + func confirm() { Task { do {