Ver código fonte

Center sidebar Pro card text for premium users so the status layout matches the subscription state.

Co-authored-by: Cursor <cursoragent@cursor.com>
AhtashamShahzad1 1 mês atrás
pai
commit
2f2aab6dcb
1 arquivos alterados com 4 adições e 2 exclusões
  1. 4 2
      Reddit App/Views/SidebarView.swift

+ 4 - 2
Reddit App/Views/SidebarView.swift

@@ -96,7 +96,7 @@ struct SidebarView: View {
     }
 
     private var upgradeCard: some View {
-        VStack(alignment: .center, spacing: 8) {
+        VStack(alignment: isPremium ? .center : .leading, spacing: 8) {
             HStack(spacing: 6) {
                 Image(systemName: "crown.fill")
                     .font(.system(size: 12))
@@ -105,6 +105,7 @@ struct SidebarView: View {
                     .font(.system(size: 12, weight: .semibold))
                     .foregroundStyle(AppTheme.textPrimary)
             }
+            .frame(maxWidth: .infinity, alignment: isPremium ? .center : .leading)
 
             Text(
                 isPremium
@@ -113,7 +114,8 @@ struct SidebarView: View {
             )
                 .font(.system(size: 10))
                 .foregroundStyle(AppTheme.textSecondary)
-                .multilineTextAlignment(.center)
+                .multilineTextAlignment(isPremium ? .center : .leading)
+                .frame(maxWidth: .infinity, alignment: isPremium ? .center : .leading)
                 .fixedSize(horizontal: false, vertical: true)
                 .lineSpacing(2)