Files
Reflect/Shared/Views/FeelsSubscriptionStoreView.swift
Trey t 086f8b8807 Add comprehensive WCAG 2.1 AA accessibility support
- Add VoiceOver labels and hints to all voting layouts, settings, widgets,
  onboarding screens, and entry cells
- Add Reduce Motion support to button animations throughout the app
- Ensure 44x44pt minimum touch targets on widget mood buttons
- Enhance AccessibilityHelpers with Dynamic Type support, ScaledValue wrapper,
  and VoiceOver detection utilities
- Gate premium features (Insights, Month/Year views) behind subscription
- Update widgets to show subscription prompts for non-subscribers

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 23:26:21 -06:00

99 lines
3.2 KiB
Swift

//
// FeelsSubscriptionStoreView.swift
// Feels
//
// Native StoreKit 2 subscription purchase view.
//
import SwiftUI
import StoreKit
struct FeelsSubscriptionStoreView: View {
@Environment(\.dismiss) private var dismiss
@EnvironmentObject var iapManager: IAPManager
var body: some View {
SubscriptionStoreView(groupID: IAPManager.subscriptionGroupID) {
VStack(spacing: 20) {
// App icon or logo
ZStack {
Circle()
.fill(
LinearGradient(
colors: [.pink.opacity(0.3), .orange.opacity(0.2)],
startPoint: .topLeading,
endPoint: .bottomTrailing
)
)
.frame(width: 100, height: 100)
Image(systemName: "heart.fill")
.font(.system(size: 44))
.foregroundStyle(
LinearGradient(
colors: [.pink, .red],
startPoint: .top,
endPoint: .bottom
)
)
}
VStack(spacing: 8) {
Text("Unlock Premium")
.font(.system(size: 28, weight: .bold, design: .rounded))
Text("Get unlimited access to all features")
.font(.system(size: 16))
.foregroundStyle(.secondary)
.multilineTextAlignment(.center)
}
// Feature highlights
VStack(alignment: .leading, spacing: 12) {
FeatureHighlight(icon: "calendar", text: "Month & Year Views")
FeatureHighlight(icon: "lightbulb.fill", text: "AI-Powered Insights")
FeatureHighlight(icon: "heart.text.square.fill", text: "Health Data Correlation")
FeatureHighlight(icon: "square.grid.2x2.fill", text: "Interactive Widgets")
}
.padding(.top, 8)
}
.padding(.horizontal, 20)
.padding(.vertical, 10)
}
.subscriptionStoreControlStyle(.prominentPicker)
.storeButton(.visible, for: .restorePurchases)
.subscriptionStoreButtonLabel(.multiline)
.tint(.pink)
.onInAppPurchaseCompletion { _, result in
if case .success(.success(_)) = result {
dismiss()
}
}
}
}
// MARK: - Feature Highlight Row
struct FeatureHighlight: View {
let icon: String
let text: String
var body: some View {
HStack(spacing: 12) {
Image(systemName: "checkmark.circle.fill")
.font(.system(size: 18))
.foregroundColor(.green)
Text(text)
.font(.system(size: 15, weight: .medium))
.foregroundColor(.primary)
Spacer()
}
}
}
#Preview {
FeelsSubscriptionStoreView()
.environmentObject(IAPManager())
}