#if os(iOS) import SwiftUI import UIKit /// The version, where to read the manual and source, report a problem or ask for help, and tips. struct AboutScreen: View { /// The app icon in use, as `AppIcons` names it. let appIcon: String static let supportEmail = "help@krz.sh" private static let site = "https://files.krz.sh/orgstar/" private var version: String { let info = Bundle.main.infoDictionary let short = info?["CFBundleShortVersionString"] as? String ?? "?" let build = info?["CFBundleVersion"] as? String ?? "?" return build == short ? short : "\(short) (\(build))" } var body: some View { Form { Section { VStack(spacing: 8) { // Builds without the asset catalog have no preview. if let icon = UIImage(named: "IconPreview-\(appIcon)") { Image(uiImage: icon) .resizable() .frame(width: 80, height: 80) .clipShape(RoundedRectangle(cornerRadius: 18, style: .continuous)) .accessibilityHidden(true) } Text("orgstar").font(.title2.bold()) Text("Version \(version)").font(.subheadline).foregroundStyle(.secondary).textSelection(.enabled) } .frame(maxWidth: .infinity) .listRowBackground(Color.clear) } Section { link("Manual", "book", Self.site) link("Release Notes", "sparkles", "https://apps.apple.com/app/id6821552018") link("Website", "globe", "https://krz.sh/apps/orgstar") } Section { link("Report an Issue", "ladybug", "https://gitbay.org/krz/orgstar-issues/issues/new") link("Email Support", "envelope", mail.absoluteString) link("Rate on the App Store", "star", "https://apps.apple.com/app/id6821552018?action=write-review") } footer: { Text("Reporting an issue needs a gitbay account. Without one, email \(Self.supportEmail).") } TipSection() Section { link("Third-Party Notices", "doc.on.doc", Self.site + "third-party.html") link("Privacy Policy", "hand.raised", "https://krz.sh/privacy/orgstar/") } footer: { Text(verbatim: "© 2026 Christian Cleberg") } } .navigationTitle("About") .navigationBarTitleDisplayMode(.inline) } /// A message to support with the version and device filled in. private var mail: URL { let device = UIDevice.current var components = URLComponents() components.scheme = "mailto" components.path = Self.supportEmail components.queryItems = [ URLQueryItem(name: "subject", value: "orgstar \(version)"), URLQueryItem(name: "body", value: "\n\n—\norgstar \(version), \(device.systemName) \(device.systemVersion), \(device.model)"), ] return components.url! } private func link(_ title: LocalizedStringKey, _ systemImage: String, _ url: String) -> some View { Link(destination: URL(string: url)!) { Label(title, systemImage: systemImage) } } } #endif