@@ -14,10 +14,6 @@ struct BalanceView: View {
1414 private var format : BalanceDisplayFormat
1515 private let balance : UInt64
1616 private var fiatPrice : Double
17- private var satsPrice : Double {
18- let usdValue = Double ( balance) . valueInUSD ( price: fiatPrice)
19- return usdValue
20- }
2117
2218 private var currencySymbol : some View {
2319 Image ( systemName: format == . fiat ? " dollarsign " : " bitcoinsign " )
@@ -38,36 +34,22 @@ struct BalanceView: View {
3834 @MainActor
3935 private var formattedBalance : String {
4036 return format. formatted ( balance, fiatPrice: fiatPrice)
41- // switch format {
42- // case .sats:
43- // return balance.formatted(.number)
44- // case .bitcoin:
45- // return String(format: "%.8f", Double(balance) / 100_000_000)
46- // case .bitcoinSats:
47- // return balance.formattedSatoshis()
48- // case .bip21q:
49- // return balance.formatted(.number)
50- // case .fiat:
51- // return satsPrice.formatted(.number.precision(.fractionLength(2)))
52- // case .bip177:
53- // return balance.formattedBip177()
54- // }
5537 }
5638
5739 @MainActor
5840 var balanceText : some View {
59- Text ( format == . fiat && satsPrice == 0 ? " 00.00 " : formattedBalance)
41+ Text ( format == . fiat && fiatPrice == 0 ? " 00.00 " : formattedBalance)
6042 . contentTransition ( . numericText( countsDown: true ) )
6143 . fontWeight ( . semibold)
6244 . fontDesign ( . rounded)
6345 . foregroundStyle (
64- format == . fiat && satsPrice == 0 ? . secondary : . primary
46+ format == . fiat && fiatPrice == 0 ? . secondary : . primary
6547 )
6648 . opacity (
67- format == . fiat && satsPrice == 0 ? balanceTextPulsingOpacity : 1
49+ format == . fiat && fiatPrice == 0 ? balanceTextPulsingOpacity : 1
6850 )
6951 . animation ( . spring( response: 0.4 , dampingFraction: 0.8 ) , value: format)
70- . animation ( . easeInOut, value: satsPrice )
52+ . animation ( . easeInOut, value: fiatPrice )
7153 . onAppear {
7254 withAnimation ( . easeInOut( duration: 1.5 ) . repeatForever ( autoreverses: true ) ) {
7355 balanceTextPulsingOpacity = 0.3
0 commit comments