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)
|
/// (on-demand)
|
||||||
public static let onDemandSuffix = Strings.tr("Localizable", "ui.connection_status.on_demand_suffix", fallback: " (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 {
|
public enum ProfileContext {
|
||||||
/// Connect to...
|
/// Connect to...
|
||||||
public static let connectTo = Strings.tr("Localizable", "ui.profile_context.connect_to", fallback: "Connect to...")
|
public static let connectTo = Strings.tr("Localizable", "ui.profile_context.connect_to", fallback: "Connect to...")
|
||||||
|
|
|
@ -246,7 +246,6 @@
|
||||||
// MARK: - Components
|
// MARK: - Components
|
||||||
|
|
||||||
"ui.connection_status.on_demand_suffix" = " (on-demand)";
|
"ui.connection_status.on_demand_suffix" = " (on-demand)";
|
||||||
"ui.interactive_coordinator.title" = "Interactive";
|
|
||||||
"ui.profile_context.connect_to" = "Connect to...";
|
"ui.profile_context.connect_to" = "Connect to...";
|
||||||
|
|
||||||
// MARK: - Paywalls
|
// MARK: - Paywalls
|
||||||
|
|
|
@ -52,6 +52,7 @@ public struct InteractiveCoordinator: View {
|
||||||
case .modal:
|
case .modal:
|
||||||
interactiveView
|
interactiveView
|
||||||
.modifier(ModalInteractiveModifier(
|
.modifier(ModalInteractiveModifier(
|
||||||
|
title: title,
|
||||||
confirm: confirm,
|
confirm: confirm,
|
||||||
cancel: cancel
|
cancel: cancel
|
||||||
))
|
))
|
||||||
|
@ -59,7 +60,7 @@ public struct InteractiveCoordinator: View {
|
||||||
case .inline(let withCancel):
|
case .inline(let withCancel):
|
||||||
interactiveView
|
interactiveView
|
||||||
.modifier(InlineInteractiveModifier(
|
.modifier(InlineInteractiveModifier(
|
||||||
title: manager.editor.profile.name,
|
title: title,
|
||||||
withCancel: withCancel,
|
withCancel: withCancel,
|
||||||
confirm: confirm,
|
confirm: confirm,
|
||||||
cancel: cancel
|
cancel: cancel
|
||||||
|
@ -72,6 +73,8 @@ public struct InteractiveCoordinator: View {
|
||||||
|
|
||||||
private extension InteractiveCoordinator {
|
private extension InteractiveCoordinator {
|
||||||
struct ModalInteractiveModifier: ViewModifier {
|
struct ModalInteractiveModifier: ViewModifier {
|
||||||
|
let title: String
|
||||||
|
|
||||||
let confirm: () -> Void
|
let confirm: () -> Void
|
||||||
|
|
||||||
let cancel: () -> Void
|
let cancel: () -> Void
|
||||||
|
@ -83,7 +86,7 @@ private extension InteractiveCoordinator {
|
||||||
}
|
}
|
||||||
.themeForm()
|
.themeForm()
|
||||||
.themeNavigationDetail()
|
.themeNavigationDetail()
|
||||||
.navigationTitle(Strings.Ui.InteractiveCoordinator.title)
|
.navigationTitle(title)
|
||||||
.toolbar(content: modalToolbar)
|
.toolbar(content: modalToolbar)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -166,6 +169,10 @@ private extension InteractiveCoordinator {
|
||||||
AnyView(provider.interactiveView(with: manager.editor, onSubmit: confirm))
|
AnyView(provider.interactiveView(with: manager.editor, onSubmit: confirm))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var title: String {
|
||||||
|
manager.editor.profile.name
|
||||||
|
}
|
||||||
|
|
||||||
func confirm() {
|
func confirm() {
|
||||||
Task {
|
Task {
|
||||||
do {
|
do {
|
||||||
|
|
Loading…
Reference in New Issue