2023-12-28 16:03:16 +01:00
|
|
|
import AppAccount
|
|
|
|
import DesignSystem
|
2024-02-14 12:48:14 +01:00
|
|
|
import Env
|
|
|
|
import SwiftUI
|
2023-12-28 16:03:16 +01:00
|
|
|
|
|
|
|
@MainActor
|
|
|
|
struct NavigationSheet<Content: View>: View {
|
|
|
|
@Environment(\.dismiss) private var dismiss
|
2024-02-14 12:48:14 +01:00
|
|
|
|
2023-12-28 16:03:16 +01:00
|
|
|
var content: () -> Content
|
2024-02-14 12:48:14 +01:00
|
|
|
|
2023-12-28 16:03:16 +01:00
|
|
|
init(@ViewBuilder content: @escaping () -> Content) {
|
|
|
|
self.content = content
|
|
|
|
}
|
2024-02-14 12:48:14 +01:00
|
|
|
|
2023-12-28 16:03:16 +01:00
|
|
|
var body: some View {
|
|
|
|
NavigationStack {
|
|
|
|
content()
|
|
|
|
.toolbar {
|
|
|
|
ToolbarItem(placement: .navigationBarLeading) {
|
|
|
|
Button {
|
|
|
|
dismiss()
|
|
|
|
} label: {
|
|
|
|
Image(systemName: "xmark.circle")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|