krz/hutch
an ios client for sourcehut
clone: git clone https://gitbay.org/krz/hutch.git
v3.8.0: Hutch/Extensions/PowerUserActions.swift · raw
1import SwiftUI
2
3struct DebugTextBlock: View {
4 let title: String
5 let content: String
6
7 var body: some View {
8 VStack(alignment: .leading, spacing: 8) {
9 Text(title)
10 .font(.caption.weight(.semibold))
11 .foregroundStyle(.secondary)
12 .textCase(.uppercase)
13
14 Text(content)
15 .font(.caption.monospaced())
16 .foregroundStyle(.primary)
17 .textSelection(.enabled)
18 .frame(maxWidth: .infinity, alignment: .leading)
19 .padding(12)
20 .background(Color(.secondarySystemBackground), in: RoundedRectangle(cornerRadius: 12))
21 }
22 }
23}
24
25struct CopyConfirmationBadge: View {
26 let message: String
27
28 var body: some View {
29 HStack(spacing: 6) {
30 Image(systemName: "checkmark.circle.fill")
31 .font(.caption)
32 Text(message)
33 .font(.caption.weight(.medium))
34 }
35 .foregroundStyle(.white)
36 .padding(.horizontal, 12)
37 .padding(.vertical, 8)
38 .background(.green.gradient, in: Capsule())
39 }
40}