[iOS] Show critic & community ratings alongside attributes (#1420)

This commit is contained in:
samglt 2025-02-06 19:59:05 -08:00 committed by GitHub
parent 98e4ae9917
commit c388ca2dec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 27 additions and 0 deletions

View File

@ -17,6 +17,33 @@ extension ItemView {
var body: some View { var body: some View {
HStack { HStack {
if let criticRating = viewModel.item.criticRating {
HStack(spacing: 2) {
Group {
if criticRating >= 60 {
Image(.tomatoFresh)
.symbolRenderingMode(.hierarchical)
} else {
Image(.tomatoRotten)
}
}
.font(.caption2)
Text("\(criticRating, specifier: "%.0f")")
}
.asAttributeStyle(.outline)
}
if let communityRating = viewModel.item.communityRating {
HStack(spacing: 2) {
Image(systemName: "star.fill")
.font(.caption2)
Text("\(communityRating, specifier: "%.1f")")
}
.asAttributeStyle(.outline)
}
if let officialRating = viewModel.item.officialRating { if let officialRating = viewModel.item.officialRating {
Text(officialRating) Text(officialRating)
.asAttributeStyle(.outline) .asAttributeStyle(.outline)