소스 검색

Fix sidebar upgrade button so the full purple area is clickable.

Move button styling into the label and add contentShape so macOS hit testing covers the entire CTA, not just the text.

Co-authored-by: Cursor <cursoragent@cursor.com>
AhtashamShahzad1 2 주 전
부모
커밋
dd08d8ab5f
1개의 변경된 파일11개의 추가작업 그리고 8개의 파일을 삭제
  1. 11 8
      App AI for Reddit/Views/SidebarView.swift

+ 11 - 8
App AI for Reddit/Views/SidebarView.swift

@@ -126,20 +126,23 @@ struct SidebarView: View {
                     .fixedSize(horizontal: false, vertical: true)
                     .lineSpacing(2)
 
-                Button(premiumActionTitle) {
+                Button {
                     if isPremium {
                         subscriptions.openSubscriptionManagement()
                     } else {
                         viewModel.showPaywall()
                     }
+                } label: {
+                    Text(premiumActionTitle)
+                        .font(.system(size: 11, weight: .semibold))
+                        .foregroundStyle(.white)
+                        .frame(maxWidth: .infinity)
+                        .padding(.vertical, 7.5)
+                        .background(AppTheme.accentPurple)
+                        .clipShape(RoundedRectangle(cornerRadius: 8))
+                        .contentShape(RoundedRectangle(cornerRadius: 8))
                 }
-                    .font(.system(size: 11, weight: .semibold))
-                    .foregroundStyle(.white)
-                    .frame(maxWidth: .infinity)
-                    .padding(.vertical, 7.5)
-                    .background(AppTheme.accentPurple)
-                    .clipShape(RoundedRectangle(cornerRadius: 8))
-                    .buttonStyle(AppPrimaryButtonStyle())
+                .buttonStyle(AppPrimaryButtonStyle())
             }
             .frame(maxWidth: .infinity, minHeight: 105)
             .padding(.horizontal, 12)