Detail badges improvement

This commit is contained in:
Arkadiusz Fal 2022-12-10 22:43:14 +01:00
parent 74d65f6ab8
commit 92999118fd

View File

@ -77,14 +77,22 @@ struct DetailBadge: View {
@Default(.roundedThumbnails) private var roundedThumbnails @Default(.roundedThumbnails) private var roundedThumbnails
var body: some View { var body: some View {
Text(text) let text = Text(text)
.truncationMode(.middle) .truncationMode(.middle)
.padding(4) .padding(4)
#if os(tvOS) #if os(tvOS)
.padding(.horizontal, 5) .padding(.horizontal, 5)
#endif #endif
.modifier(StyleModifier(style: style))
.mask(RoundedRectangle(cornerRadius: roundedThumbnails ? 6 : 0)) Group {
if style == .default {
text
} else {
text
.modifier(StyleModifier(style: style))
}
}
.mask(RoundedRectangle(cornerRadius: roundedThumbnails ? 6 : 0))
} }
} }