Commit ca0b053c5c
Verified · cmc
Sources/OrgstarMobile/ProScreen.swift +6 −5 · view
| @@ -124,7 +124,7 @@ struct ProScreen: View { | |||
| 124 | detail(product).font(.subheadline).foregroundStyle(.secondary) | 124 | detail(product).font(.subheadline).foregroundStyle(.secondary) |
| 125 | } | 125 | } |
| 126 | Spacer() | 126 | Spacer() |
| 127 | Text(product.displayPrice + period(product)) | 127 | Text(price(product)) |
| 128 | .font(.headline) | 128 | .font(.headline) |
| 129 | .monospacedDigit() | 129 | .monospacedDigit() |
| 130 | .foregroundStyle(Color.accentColor) | 130 | .foregroundStyle(Color.accentColor) |
| @@ -159,11 +159,12 @@ struct ProScreen: View { | |||
| 159 | } | 159 | } |
| 160 | } | 160 | } |
| 161 | 161 | ||
| 162 | private func period(_ product: Product) -> String { | 162 | /// The price, and the period a subscription bills for. |
| 163 | private func price(_ product: Product) -> String { | ||
| 163 | switch product.subscription?.subscriptionPeriod.unit { | 164 | switch product.subscription?.subscriptionPeriod.unit { |
| 164 | case .month: " / month" | 165 | case .month: String(localized: "\(product.displayPrice) / month") |
| 165 | case .year: " / year" | 166 | case .year: String(localized: "\(product.displayPrice) / year") |
| 166 | default: "" | 167 | default: product.displayPrice |
| 167 | } | 168 | } |
| 168 | } | 169 | } |
| 169 | } | 170 | } |