[iOS] Show critic & community ratings alongside attributes (#1420)
This commit is contained in:
parent
98e4ae9917
commit
c388ca2dec
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue