소스 검색

Evenly distribute paywall footer links and pin the bar to the bottom.

Co-authored-by: Cursor <cursoragent@cursor.com>
AhtashamShahzad1 1 개월 전
부모
커밋
c0a6731e27
2개의 변경된 파일28개의 추가작업 그리고 14개의 파일을 삭제
  1. 6 0
      Reddit App/Models/PaywallModels.swift
  2. 22 14
      Reddit App/Views/PaywallView.swift

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

@@ -81,4 +81,10 @@ enum PaywallContent {
         PaywallFeature(title: "Custom AI Prompts", systemImage: "wand.and.stars"),
         PaywallFeature(title: "Post Analytics", systemImage: "chart.bar.fill"),
     ]
+
+    static let continueWithFreePlan = "Continue with free plan"
+    static let restorePurchases = "Restore Purchases"
+    static let privacyPolicy = "Privacy Policy"
+    static let support = "Support"
+    static let termsOfService = "Terms of Services"
 }

+ 22 - 14
Reddit App/Views/PaywallView.swift

@@ -17,6 +17,7 @@ struct PaywallView: View {
                     featuresSection(metrics: metrics)
                     pricingCards(metrics: metrics)
                     ctaSection(metrics: metrics)
+                    Spacer(minLength: 0)
                     footerLinks(metrics: metrics)
                 }
                 .padding(.horizontal, metrics.horizontalInset)
@@ -125,32 +126,39 @@ struct PaywallView: View {
     }
 
     private func footerLinks(metrics: PaywallLayoutMetrics) -> some View {
-        HStack {
-            Button("Continue with free plan") {
+        HStack(spacing: 0) {
+            footerLink(PaywallContent.continueWithFreePlan, metrics: metrics) {
                 onDismiss()
             }
-            .buttonStyle(.plain)
-            .font(.system(size: metrics.footerLinkFontSize))
-            .foregroundStyle(AppTheme.textSecondary)
 
-            Spacer()
+            Spacer(minLength: metrics.footerLinkSpacing)
 
-            HStack(spacing: metrics.footerLinkSpacing) {
-                footerLink("Restore Purchases", metrics: metrics) {
-                    viewModel.restorePurchases()
-                }
-                footerLink("Privacy Policy", metrics: metrics) {}
-                footerLink("Support", metrics: metrics) {}
-                footerLink("Terms of Services", metrics: metrics) {}
+            footerLink(PaywallContent.restorePurchases, metrics: metrics) {
+                viewModel.restorePurchases()
             }
+
+            Spacer(minLength: metrics.footerLinkSpacing)
+
+            footerLink(PaywallContent.privacyPolicy, metrics: metrics) {}
+
+            Spacer(minLength: metrics.footerLinkSpacing)
+
+            footerLink(PaywallContent.support, metrics: metrics) {}
+
+            Spacer(minLength: metrics.footerLinkSpacing)
+
+            footerLink(PaywallContent.termsOfService, metrics: metrics) {}
         }
+        .frame(maxWidth: .infinity)
     }
 
     private func footerLink(_ title: String, metrics: PaywallLayoutMetrics, action: @escaping () -> Void) -> some View {
         Button(title, action: action)
             .buttonStyle(.plain)
             .font(.system(size: metrics.footerLinkFontSize))
-            .foregroundStyle(AppTheme.textTertiary)
+            .foregroundStyle(AppTheme.textSecondary)
+            .lineLimit(1)
+            .minimumScaleFactor(0.8)
     }
 }