Преглед изворни кода

Remove icon badge backgrounds from quick-action chips for a cleaner layout.

Co-authored-by: Cursor <cursoragent@cursor.com>
AhtashamShahzad1 пре 3 недеља
родитељ
комит
4f84aa1077

+ 0 - 1
clone _of_clarus_ai_chat_bot/Utilities/AppTheme.swift

@@ -41,6 +41,5 @@ enum AppTheme {
     static let quickActionBackground = chatInputBackground
     static let quickActionForeground = textPrimary
     static let quickActionBorder = chatInputBorder
-    static let quickActionIconBackground = Color(red: 0.94, green: 0.94, blue: 0.95)
     static let quickActionSelectedForeground = Color.white
 }

+ 7 - 26
clone _of_clarus_ai_chat_bot/Views/QuickActionChip.swift

@@ -5,22 +5,21 @@ struct QuickActionChip: View {
     let isSelected: Bool
     let onSelect: () -> Void
 
-    private let iconBadgeWidth: CGFloat = 34
-    private let iconBadgeHeight: CGFloat = 26
-    private let iconSize: CGFloat = 13
-
     var body: some View {
         Button(action: onSelect) {
             HStack(spacing: 7) {
-                iconBadge
+                Image(systemName: action.symbol)
+                    .font(.system(size: 13, weight: .semibold))
+                    .foregroundStyle(foregroundColor)
+                    .symbolRenderingMode(.hierarchical)
+                    .frame(width: 18)
 
                 Text(action.title)
                     .font(.system(size: 12.5, weight: .medium))
                     .foregroundStyle(foregroundColor)
             }
-            .padding(.leading, 6)
-            .padding(.trailing, 12)
-            .padding(.vertical, 5)
+            .padding(.horizontal, 12)
+            .padding(.vertical, 8)
             .background(
                 RoundedRectangle(cornerRadius: AppTheme.chatInputCornerRadius, style: .continuous)
                     .fill(backgroundColor)
@@ -40,18 +39,6 @@ struct QuickActionChip: View {
         .accessibilityAddTraits(isSelected ? .isSelected : [])
     }
 
-    private var iconBadge: some View {
-        RoundedRectangle(cornerRadius: 8, style: .continuous)
-            .fill(iconBadgeBackground)
-            .frame(width: iconBadgeWidth, height: iconBadgeHeight)
-            .overlay {
-                Image(systemName: action.symbol)
-                    .font(.system(size: iconSize, weight: .semibold))
-                    .foregroundStyle(foregroundColor)
-                    .symbolRenderingMode(.hierarchical)
-            }
-    }
-
     private var backgroundColor: Color {
         isSelected ? AppTheme.accent : AppTheme.quickActionBackground
     }
@@ -63,10 +50,4 @@ struct QuickActionChip: View {
     private var foregroundColor: Color {
         isSelected ? AppTheme.quickActionSelectedForeground : AppTheme.quickActionForeground
     }
-
-    private var iconBadgeBackground: Color {
-        isSelected
-            ? Color.white.opacity(0.22)
-            : AppTheme.quickActionIconBackground
-    }
 }