-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathErrorPanel.swift
More file actions
29 lines (26 loc) · 866 Bytes
/
ErrorPanel.swift
File metadata and controls
29 lines (26 loc) · 866 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import SwiftUI
import SharedUIComponents
struct ErrorPanel: View {
var description: String
var onCloseButtonTap: () -> Void
var body: some View {
ZStack(alignment: .topTrailing) {
Text(description)
.multilineTextAlignment(.leading)
.frame(maxWidth: .infinity, alignment: .leading)
.foregroundColor(.white)
.padding()
.background(Color.red)
// close button
Button(action: onCloseButtonTap) {
Image(systemName: "xmark")
.scaledFont(.body)
.padding([.leading, .bottom], 16)
.padding([.top, .trailing], 8)
.foregroundColor(.white)
}
.buttonStyle(.plain)
}
.xcodeStyleFrame()
}
}