Commit 45741a5160
Unsigned
Layout: unified · split
DomainDig/AppInfoView.swift +6 −9
| @@ -1,14 +1,11 @@ | |||
| 1 | import StoreKit | ||
| 2 | import SwiftUI | 1 | import SwiftUI |
| 3 | 2 | ||
| 4 | /// Settings → App Info. Shows app/build metadata and links out to docs, source, | 3 | /// Settings → App Info. Shows app/build metadata and links out to docs, source, |
| 5 | /// privacy, support, and the App Store. The actionable rows are driven by a | 4 | /// privacy, support, and the App Store. The actionable rows are driven by a |
| 6 | /// single declarative `AppInfoRow` model so titles, icons, and destinations live | 5 | /// single declarative `AppInfoRow` model so titles, icons, and destinations live |
| 7 | /// in one place; only the Rate and Share rows are special-cased (a StoreKit | 6 | /// in one place; only the Share row is special-cased (a `ShareLink` view). |
| 8 | /// action and a `ShareLink` view, respectively). | ||
| 9 | struct AppInfoView: View { | 7 | struct AppInfoView: View { |
| 10 | @Environment(\.openURL) private var openURL | 8 | @Environment(\.openURL) private var openURL |
| 11 | @Environment(\.requestReview) private var requestReview | ||
| 12 | @State private var cloudSyncService = CloudSyncService.shared | 9 | @State private var cloudSyncService = CloudSyncService.shared |
| 13 | @State private var activeSheet: AppInfoSheet? | 10 | @State private var activeSheet: AppInfoSheet? |
| 14 | 11 | ||
| @@ -29,20 +26,20 @@ struct AppInfoView: View { | |||
| 29 | ForEach(supportRows) { row($0) } | 26 | ForEach(supportRows) { row($0) } |
| 30 | } | 27 | } |
| 31 | 28 | ||
| 32 | Section("Support the App") { | 29 | Section { |
| 33 | Button { | 30 | Button { |
| 34 | requestReview() | 31 | openURL(AppLinks.writeReview) |
| 35 | } label: { | 32 | } label: { |
| 36 | Label("Rate DomainDig", systemImage: "star") | 33 | Label("Rate DomainDig", systemImage: "star") |
| 37 | } | 34 | } |
| 35 | .accessibilityHint("Opens the App Store") | ||
| 38 | 36 | ||
| 39 | ShareLink(item: AppLinks.appStoreListing) { | 37 | ShareLink(item: AppLinks.appStoreListing) { |
| 40 | Label("Share DomainDig", systemImage: "square.and.arrow.up") | 38 | Label("Share DomainDig", systemImage: "square.and.arrow.up") |
| 41 | } | 39 | } |
| 42 | .accessibilityHint("Opens the share sheet") | 40 | .accessibilityHint("Opens the share sheet") |
| 43 | } | 41 | } header: { |
| 44 | 42 | Text("Support the App") | |
| 45 | Section { | ||
| 46 | } footer: { | 43 | } footer: { |
| 47 | Text(AppLinks.copyright) | 44 | Text(AppLinks.copyright) |
| 48 | .frame(maxWidth: .infinity, alignment: .center) | 45 | .frame(maxWidth: .infinity, alignment: .center) |