Adjust the PillView and BadgeLabel to the new compound styles

This commit is contained in:
Stefan Ceriu
2026-03-19 14:55:54 +02:00
parent d544a5874a
commit a164812f50
2 changed files with 14 additions and 3 deletions
+2 -2
View File
@@ -15,11 +15,11 @@ struct PillView: View {
let didChangeText: () -> Void let didChangeText: () -> Void
var textColor: Color { var textColor: Color {
context.viewState.isOwnMention ? .compound.textBadgeAccent : .compound.textPrimary context.viewState.isOwnMention ? .compound.textBadgeAccent : .compound.textOnSolidPrimary
} }
var backgroundColor: Color { var backgroundColor: Color {
context.viewState.isOwnMention ? .compound.bgBadgeAccent : .compound.bgBadgeDefault context.viewState.isOwnMention ? .compound.bgBadgeAccent : .compound.bgBadgePrimary
} }
var body: some View { var body: some View {
@@ -55,6 +55,13 @@ struct BadgeLabel: View {
} }
} }
var borderColor: Color {
switch style {
case .default: .compound.borderInteractiveSecondary
default: .clear
}
}
func makeBody(configuration: Configuration) -> some View { func makeBody(configuration: Configuration) -> some View {
HStack(spacing: 4) { HStack(spacing: 4) {
configuration.icon configuration.icon
@@ -66,7 +73,11 @@ struct BadgeLabel: View {
.padding(.leading, 8) .padding(.leading, 8)
.padding(.trailing, 12) .padding(.trailing, 12)
.padding(.vertical, 4) .padding(.vertical, 4)
.background(Capsule().fill(backgroundColor)) .background {
Capsule().fill(backgroundColor).overlay {
Capsule().stroke(borderColor)
}
}
} }
} }
} }