Use profile name as interactive view title
This commit is contained in:
parent
fbe2d84113
commit
1d2de39d49
|
@ -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...")
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue