mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-02-24 23:38:57 +01:00
FIX: colors were hard to read
This commit is contained in:
parent
4143634bd0
commit
41f8a22a21
1 changed files with 12 additions and 3 deletions
|
@ -2,6 +2,8 @@ import SwiftUI
|
||||||
|
|
||||||
@available(iOS 15.0, *)
|
@available(iOS 15.0, *)
|
||||||
struct CompactPriceView: View {
|
struct CompactPriceView: View {
|
||||||
|
@Environment(\.colorScheme) var colorScheme
|
||||||
|
|
||||||
let price: String
|
let price: String
|
||||||
let lastUpdated: String
|
let lastUpdated: String
|
||||||
let code: String
|
let code: String
|
||||||
|
@ -12,14 +14,16 @@ struct CompactPriceView: View {
|
||||||
Text(price)
|
Text(price)
|
||||||
.font(.title)
|
.font(.title)
|
||||||
.bold()
|
.bold()
|
||||||
|
.foregroundColor(priceTextColor)
|
||||||
|
.shadow(color: Color.black.opacity(0.2), radius: 1, x: 0, y: 1)
|
||||||
.multilineTextAlignment(.center)
|
.multilineTextAlignment(.center)
|
||||||
.dynamicTypeSize(.large ... .accessibility5)
|
.dynamicTypeSize(.large ... .accessibility5)
|
||||||
.accessibilityLabel("Bitcoin price: \(price)")
|
.accessibilityLabel("Bitcoin price: \(price)")
|
||||||
|
|
||||||
VStack(alignment: .center, spacing: 8) {
|
VStack(alignment: .center, spacing: 8) {
|
||||||
Text("\(code)")
|
Text(code)
|
||||||
Text("\(lastUpdated)")
|
Text(lastUpdated)
|
||||||
Text("\(dataSource)")
|
Text(dataSource)
|
||||||
}
|
}
|
||||||
.font(.subheadline)
|
.font(.subheadline)
|
||||||
.foregroundColor(.secondary)
|
.foregroundColor(.secondary)
|
||||||
|
@ -29,4 +33,9 @@ struct CompactPriceView: View {
|
||||||
.padding()
|
.padding()
|
||||||
.frame(maxWidth: .infinity)
|
.frame(maxWidth: .infinity)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Adaptive color for the price text using system built-in colors
|
||||||
|
var priceTextColor: Color {
|
||||||
|
colorScheme == .dark ? .cyan : .blue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue