From 6a4171efd21af8452348fdffd247ae084006ff0c Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Thu, 19 Mar 2026 14:55:54 +0200 Subject: [PATCH] Adjust the `PillView` and `BadgeLabel` to the new compound styles --- ElementX/Sources/Other/Pills/PillView.swift | 4 ++-- .../Sources/Other/SwiftUI/Views/BadgeLabel.swift | 13 ++++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ElementX/Sources/Other/Pills/PillView.swift b/ElementX/Sources/Other/Pills/PillView.swift index 28d49fd0b..c041e7a15 100644 --- a/ElementX/Sources/Other/Pills/PillView.swift +++ b/ElementX/Sources/Other/Pills/PillView.swift @@ -15,11 +15,11 @@ struct PillView: View { let didChangeText: () -> Void var textColor: Color { - context.viewState.isOwnMention ? .compound.textBadgeAccent : .compound.textPrimary + context.viewState.isOwnMention ? .compound.textBadgeAccent : .compound.textOnSolidPrimary } var backgroundColor: Color { - context.viewState.isOwnMention ? .compound.bgBadgeAccent : .compound.bgBadgeDefault + context.viewState.isOwnMention ? .compound.bgBadgeAccent : .compound.bgBadgePrimary } var body: some View { diff --git a/ElementX/Sources/Other/SwiftUI/Views/BadgeLabel.swift b/ElementX/Sources/Other/SwiftUI/Views/BadgeLabel.swift index bf784bddf..557915a79 100644 --- a/ElementX/Sources/Other/SwiftUI/Views/BadgeLabel.swift +++ b/ElementX/Sources/Other/SwiftUI/Views/BadgeLabel.swift @@ -55,6 +55,13 @@ struct BadgeLabel: View { } } + var borderColor: Color { + switch style { + case .default: .compound.borderInteractiveSecondary + default: .clear + } + } + func makeBody(configuration: Configuration) -> some View { HStack(spacing: 4) { configuration.icon @@ -66,7 +73,11 @@ struct BadgeLabel: View { .padding(.leading, 8) .padding(.trailing, 12) .padding(.vertical, 4) - .background(Capsule().fill(backgroundColor)) + .background { + Capsule().fill(backgroundColor).overlay { + Capsule().stroke(borderColor) + } + } } } }