diff options
| author | Christian Cleberg <[email protected]> | 2026-04-11 11:48:40 -0500 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2026-04-11 11:48:40 -0500 |
| commit | fcf864a15b70e4ecb5bd789b1db3116221c34394 (patch) | |
| tree | f15315324b9f95286b6bf7392dd0ccaee210c2de /Rune/Views/Shared/FeedbackViews.swift | |
| parent | cf587aa0573ac4f34e1effe70108a9eca82093ac (diff) | |
| download | rune-fcf864a15b70e4ecb5bd789b1db3116221c34394.tar.gz rune-fcf864a15b70e4ecb5bd789b1db3116221c34394.tar.bz2 rune-fcf864a15b70e4ecb5bd789b1db3116221c34394.zip | |
add FUNDING.yml
Diffstat (limited to 'Rune/Views/Shared/FeedbackViews.swift')
| -rw-r--r-- | Rune/Views/Shared/FeedbackViews.swift | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/Rune/Views/Shared/FeedbackViews.swift b/Rune/Views/Shared/FeedbackViews.swift new file mode 100644 index 0000000..9267ce2 --- /dev/null +++ b/Rune/Views/Shared/FeedbackViews.swift @@ -0,0 +1,38 @@ +import SwiftUI + +struct InlineErrorView: View { + let message: String + let retryTitle: String + let retryAction: () -> Void + + var body: some View { + VStack(alignment: .leading, spacing: 8) { + Text(message) + .font(.subheadline) + .foregroundStyle(.red) + + Button(retryTitle, action: retryAction) + .font(.subheadline.weight(.semibold)) + } + .frame(maxWidth: .infinity, alignment: .leading) + .padding() + .background(Color.red.opacity(0.08), in: RoundedRectangle(cornerRadius: 12, style: .continuous)) + } +} + +struct FeedbackBanner: View { + let message: String + let tint: Color + + var body: some View { + Text(message) + .font(.subheadline.weight(.semibold)) + .foregroundStyle(tint) + .frame(maxWidth: .infinity, alignment: .leading) + .padding(.horizontal, 14) + .padding(.vertical, 10) + .background(tint.opacity(0.12), in: RoundedRectangle(cornerRadius: 12, style: .continuous)) + .padding(.horizontal) + .padding(.top, 8) + } +} |
