Update ios/Widgets/PriceWidget/PriceIntent.swift

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
Marcos Rodriguez Vélez 2024-10-27 23:17:09 -04:00 committed by GitHub
parent ff3ec2d51e
commit d827464821
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -74,15 +74,18 @@ struct CompactPriceView: View {
VStack {
Text(priceFormatted)
.font(.title)
.accessibilityLabel("Bitcoin price: \(priceFormatted)")
Text(detailsText)
.font(.caption)
.foregroundColor(.gray)
.accessibilityLabel("Last updated \(lastUpdated) from \(dataSource)")
.padding(.top, 8)
.lineLimit(1)
.minimumScaleFactor(0.5)
.multilineTextAlignment(.center)
}
.frame(maxWidth: 200)
.frame(maxWidth: .infinity)
.frame(idealWidth: 200)
.padding()
.background(.ultraThinMaterial)
.cornerRadius(10)
@ -92,7 +95,9 @@ struct CompactPriceView: View {
let formatter = NumberFormatter()
formatter.numberStyle = .currency
formatter.currencyCode = currencyCode
formatter.locale = Locale(identifier: Locale.current.identifier)
formatter.maximumFractionDigits = 2
formatter.minimumFractionDigits = 2
return formatter.string(from: NSNumber(value: price)) ?? "--"
}