feat: Updates flagged status label styles
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user