瀏覽代碼

Update paywall pricing cards to align Lifetime with app features and move the Best Value badge to the top-right.

Co-authored-by: Cursor <cursoragent@cursor.com>
AhtashamShahzad1 1 月之前
父節點
當前提交
e327bf3ad5
共有 2 個文件被更改,包括 22 次插入30 次删除
  1. 6 15
      Reddit App/Models/PaywallModels.swift
  2. 16 15
      Reddit App/Views/PaywallView.swift

+ 6 - 15
Reddit App/Models/PaywallModels.swift

@@ -69,24 +69,15 @@ enum PaywallPlan: String, CaseIterable, Identifiable {
     }
 
     var isBestValue: Bool {
-        self == .yearly
+        self == .lifetime
     }
 
     var features: [String] {
-        switch self {
-        case .monthly, .yearly:
-            [
-                "Unlimited AI Generations",
-                "Post Generator & Title Optimizer",
-                "Comment Writer with smart replies",
-            ]
-        case .lifetime:
-            [
-                "Pay once, use forever",
-                "Priority Support",
-                "Multi-device Sync",
-            ]
-        }
+        [
+            "Unlimited AI Generations",
+            "Post Generator & Title Optimizer",
+            "Comment Writer with smart replies",
+        ]
     }
 }
 

+ 16 - 15
Reddit App/Views/PaywallView.swift

@@ -323,21 +323,9 @@ private struct PaywallPricingCard: View {
     var body: some View {
         Button(action: onSelect) {
             VStack(alignment: .leading, spacing: 0) {
-                if plan.isBestValue {
-                    Text("BEST VALUE")
-                        .font(.system(size: metrics.featureFontSize * 0.75, weight: .bold))
-                        .foregroundStyle(Color(hex: 0x0B0E14))
-                        .padding(.horizontal, 10)
-                        .padding(.vertical, 4)
-                        .background(AppTheme.accentTeal)
-                        .clipShape(Capsule())
-                        .frame(maxWidth: .infinity)
-                        .padding(.bottom, metrics.cardPadding)
-                } else {
-                    Color.clear
-                        .frame(height: metrics.cardPadding * 1.6)
-                        .padding(.bottom, metrics.cardPadding * 0.4)
-                }
+                Color.clear
+                    .frame(height: metrics.cardPadding * 1.0)
+                    .padding(.bottom, metrics.cardPadding * 0.15)
 
                 Text(plan.title)
                     .font(.system(size: metrics.ctaFontSize, weight: .semibold))
@@ -395,6 +383,19 @@ private struct PaywallPricingCard: View {
                         lineWidth: isSelected ? 2 : 1
                     )
             )
+            .overlay(alignment: .topTrailing) {
+                if plan.isBestValue {
+                    Text("BEST VALUE")
+                        .font(.system(size: metrics.featureFontSize * 0.75, weight: .bold))
+                        .foregroundStyle(Color(hex: 0x0B0E14))
+                        .padding(.horizontal, 10)
+                        .padding(.vertical, 4)
+                        .background(AppTheme.accentTeal)
+                        .clipShape(Capsule())
+                        .padding(.top, metrics.cardPadding * 0.65)
+                        .padding(.trailing, metrics.cardPadding * 0.65)
+                }
+            }
         }
         .buttonStyle(.plain)
     }