mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 20:24:06 +00:00
Less obnoxious error handling
This commit is contained in:
23
Shared/Views/RequestErrorButton.swift
Normal file
23
Shared/Views/RequestErrorButton.swift
Normal 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()
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user