Files
Reflect/Shared/Views/FeelsSubscriptionStoreView.swift
Trey t 920aaee35c Add premium features and reorganize Settings tab
Premium Features:
- Journal notes and photo attachments for mood entries
- Data export (CSV and PDF reports)
- Privacy lock with Face ID/Touch ID
- Apple Health integration for mood correlation
- 4 new personality packs (Motivational Coach, Zen Master, Best Friend, Data Analyst)

Settings Tab Reorganization:
- Combined Customize and Settings into single tab with segmented control
- Added upgrade banner with trial countdown above segment
- "Why Upgrade?" sheet showing all premium benefits
- Subscribe button opens improved StoreKit 2 subscription view

UI Improvements:
- Enhanced subscription store with feature highlights
- Entry detail view for viewing/editing notes and photos
- Removed duplicate subscription banners from tab content

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-13 12:22:06 -06:00

99 lines
3.1 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: "photo.fill", text: "Photos & Journal Notes")
FeatureHighlight(icon: "heart.fill", text: "Health Data Correlation")
}
.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())
}