feat: Updates flagged status label styles

This commit is contained in:
2024-06-07 18:37:49 -04:00
parent 280cb3b863
commit 11ec24586e
7 changed files with 211 additions and 34 deletions

View File

@@ -159,6 +159,30 @@ extension AnyTextLabelStyle {
}
public struct PillViewTextLabelStyle: TextLabelStyle {
let labelColor: Color?
let pillColor: Color
public func makeBody(configuration: Configuration) -> some View {
configuration.label
.foregroundStyle(labelColor ?? .primary)
.background {
Capsule()
.foregroundStyle(pillColor)
}
}
}
extension TextLabelStyle where Self == PillViewTextLabelStyle {
public static func pill(
pillColor: Color,
labelColor: Color? = nil
) -> Self {
.init(labelColor: labelColor, pillColor: pillColor)
}
}
extension View {
public func textLabelStyle(_ style: AnyTextLabelStyle) -> some View {