Less obnoxious error handling

This commit is contained in:
Arkadiusz Fal
2022-12-16 09:35:10 +01:00
parent a9c8053474
commit 4330856c5e
10 changed files with 97 additions and 25 deletions

View File

@@ -0,0 +1,23 @@
import Siesta
import SwiftUI
struct RequestErrorButton: View {
var error: RequestError?
var body: some View {
if let error {
Button {
NavigationModel.shared.presentRequestErrorAlert(error)
} label: {
Label("Error", systemImage: "exclamationmark.circle.fill")
.foregroundColor(Color("AppRedColor"))
}
}
}
}
struct RequestErrorButton_Previews: PreviewProvider {
static var previews: some View {
RequestErrorButton()
}
}