Navigation angepasst, Absprung in angetippten song.

This commit is contained in:
2026-04-07 12:57:24 +02:00
parent 040917479e
commit fe3ed1e204
9 changed files with 361 additions and 4 deletions
@@ -6,6 +6,7 @@
//
import SwiftUI
import StoreKit
struct MainTabView: View {
@Environment(MAService.self) private var service
@@ -381,7 +382,9 @@ struct PlayerRow: View {
struct SettingsView: View {
@Environment(MAService.self) private var service
@Environment(MAStoreManager.self) private var storeManager
@Environment(\.themeManager) private var themeManager
@State private var showThankYou = false
var body: some View {
NavigationStack {
@@ -455,8 +458,76 @@ struct SettingsView: View {
Label("Disconnect", systemImage: "arrow.right.square")
}
}
// Support Development Section
Section {
if storeManager.products.isEmpty {
HStack {
Spacer()
ProgressView()
Spacer()
}
} else {
ForEach(storeManager.products, id: \.id) { product in
Button {
Task {
await storeManager.purchase(product)
}
} label: {
HStack(spacing: 12) {
Image(systemName: storeManager.iconName(for: product.id))
.font(.title2)
.foregroundStyle(.orange)
.frame(width: 32)
VStack(alignment: .leading, spacing: 2) {
Text(storeManager.tierName(for: product.id))
.font(.body)
.foregroundStyle(.primary)
Text(product.description)
.font(.caption)
.foregroundStyle(.secondary)
}
Spacer()
Text(product.displayPrice)
.font(.subheadline.weight(.semibold))
.foregroundStyle(.orange)
.padding(.horizontal, 12)
.padding(.vertical, 6)
.background(
Capsule()
.fill(.orange.opacity(0.15))
)
}
.padding(.vertical, 4)
}
.buttonStyle(.plain)
.disabled(storeManager.isPurchasing)
}
}
} header: {
Text("Support Development")
} footer: {
Text("Donations help keep this app updated and ad-free. Thank you!")
}
}
.navigationTitle("Settings")
.task {
await storeManager.loadProducts()
}
.alert("Thank You!", isPresented: $showThankYou) {
Button("OK", role: .cancel) { }
} message: {
Text("Your support means a lot and helps keep this app alive!")
}
.onChange(of: storeManager.purchaseResult) {
if case .success = storeManager.purchaseResult {
showThankYou = true
storeManager.purchaseResult = nil
}
}
}
}
}