Răsfoiți Sursa

Update paywall footer actions.

Co-authored-by: Cursor <cursoragent@cursor.com>
huzaifahayat12 2 luni în urmă
părinte
comite
2a57e4a1ac
1 a modificat fișierele cu 18 adăugiri și 33 ștergeri
  1. 18 33
      zoom_app/ViewController.swift

+ 18 - 33
zoom_app/ViewController.swift

@@ -1702,7 +1702,7 @@ class ViewController: NSViewController {
     }
 
     @objc private func upgradeToProTapped() {
-        if storeKitCoordinator.hasPremiumAccess {
+        if storeKitCoordinator.hasLifetimePremiumAccess {
             openManageSubscriptions()
         } else {
             showPaywall()
@@ -3997,19 +3997,16 @@ class ViewController: NSViewController {
         secureWrap.widthAnchor.constraint(equalTo: planColumn.widthAnchor).isActive = true
         planColumn.setCustomSpacing(8, after: secureWrap)
 
-        let manageButton = paywallFooterButton(
-            title: "Manage Subscription",
-            action: #selector(paywallManageSubscriptionClicked(_:))
+        let primaryFooterButton = paywallFooterButton(
+            title: storeKitCoordinator.hasPremiumAccess ? "Manage Subscription" : "Continue with free plan",
+            action: storeKitCoordinator.hasPremiumAccess
+                ? #selector(paywallManageSubscriptionClicked(_:))
+                : #selector(closePaywallClicked(_:))
         )
         let restoreButton = paywallFooterButton(
             title: "Restore Purchase",
             action: #selector(paywallRestorePurchaseClicked(_:))
         )
-        let freePlanButton = paywallFooterButton(
-            title: "Continue with free plan",
-            action: #selector(closePaywallClicked(_:))
-        )
-        freePlanButton.contentTintColor = secondaryText
         let privacyButton = paywallFooterButton(
             title: "Privacy Policy",
             action: #selector(paywallPrivacyPolicyClicked(_:))
@@ -4023,40 +4020,28 @@ class ViewController: NSViewController {
             action: #selector(paywallTermsOfServicesClicked(_:))
         )
 
-        // Footer: single centered line.
+        // Footer: evenly spaced links across the paywall width.
         let footerContent = NSStackView()
         footerContent.translatesAutoresizingMaskIntoConstraints = false
         footerContent.orientation = .horizontal
         footerContent.alignment = .centerY
-        footerContent.distribution = .fill
-        footerContent.spacing = 16
-        footerContent.addArrangedSubview(manageButton)
+        footerContent.distribution = .equalSpacing
+        footerContent.spacing = 36
+        footerContent.addArrangedSubview(primaryFooterButton)
         footerContent.addArrangedSubview(restoreButton)
-        footerContent.addArrangedSubview(freePlanButton)
         footerContent.addArrangedSubview(privacyButton)
         footerContent.addArrangedSubview(supportButton)
         footerContent.addArrangedSubview(termsButton)
 
-        let footerWrap = NSStackView()
+        let footerWrap = NSView()
         footerWrap.translatesAutoresizingMaskIntoConstraints = false
-        footerWrap.orientation = .horizontal
-        footerWrap.alignment = .centerY
-        footerWrap.distribution = .fill
-
-        let footerLeftSpacer = NSView()
-        footerLeftSpacer.translatesAutoresizingMaskIntoConstraints = false
-        let footerRightSpacer = NSView()
-        footerRightSpacer.translatesAutoresizingMaskIntoConstraints = false
-        footerLeftSpacer.setContentHuggingPriority(.defaultLow, for: .horizontal)
-        footerLeftSpacer.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
-        footerRightSpacer.setContentHuggingPriority(.defaultLow, for: .horizontal)
-        footerRightSpacer.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
-        footerContent.setContentHuggingPriority(.required, for: .horizontal)
-        footerContent.setContentCompressionResistancePriority(.required, for: .horizontal)
-
-        footerWrap.addArrangedSubview(footerLeftSpacer)
-        footerWrap.addArrangedSubview(footerContent)
-        footerWrap.addArrangedSubview(footerRightSpacer)
+        footerWrap.addSubview(footerContent)
+        NSLayoutConstraint.activate([
+            footerContent.leadingAnchor.constraint(equalTo: footerWrap.leadingAnchor, constant: 44),
+            footerContent.trailingAnchor.constraint(equalTo: footerWrap.trailingAnchor, constant: -44),
+            footerContent.topAnchor.constraint(equalTo: footerWrap.topAnchor),
+            footerContent.bottomAnchor.constraint(equalTo: footerWrap.bottomAnchor)
+        ])
 
         // Push footer to the bottom of the paywall.
         let footerPushSpacer = NSView()