Skip to content

Commit

Permalink
Fixed issue with empty SF Symbol name
Browse files Browse the repository at this point in the history
  • Loading branch information
mszpro committed Feb 2, 2023
1 parent fdcb7dc commit 690b706
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Sources/SwiftUILibrary/TagView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,13 @@ public struct TagView: View {
self.sfSymbolImageName = sfSymbolImageName
}
public var body: some View {
Label(tagContent, systemImage: sfSymbolImageName)
Group {
if sfSymbolImageName.isEmpty {
Text(tagContent)
} else {
Label(tagContent, systemImage: sfSymbolImageName)
}
}
.font(textFont)
.foregroundColor((tagStyle == .borderedProminent) ? .white : tagBackgroundColor)
.padding(textPadding)
Expand Down

0 comments on commit 690b706

Please sign in to comment.