|
|
@@ -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
|
|
|
- }
|
|
|
}
|