@@ -13,14 +13,32 @@ struct TransactionListView: View {
1313 @Bindable var viewModel : TransactionListViewModel
1414 let transactions : [ CanonicalTx ]
1515 let walletSyncState : WalletSyncState
16-
16+ private let format : BalanceDisplayFormat
17+ private let fiatPrice : Double
18+
19+ init (
20+ viewModel: TransactionListViewModel ,
21+ transactions: [ CanonicalTx ] ,
22+ walletSyncState: WalletSyncState ,
23+ format: BalanceDisplayFormat ,
24+ fiatPrice: Double
25+ ) {
26+ self . viewModel = viewModel
27+ self . transactions = transactions
28+ self . walletSyncState = walletSyncState
29+ self . format = format
30+ self . fiatPrice = fiatPrice
31+ }
32+
1733 var body : some View {
1834
1935 List {
2036 if transactions. isEmpty && walletSyncState == . syncing {
2137 TransactionItemView (
2238 txDetails: . mock,
23- isRedacted: true
39+ isRedacted: true ,
40+ format: format,
41+ fiatPrice: fiatPrice
2442 )
2543 . listRowInsets ( EdgeInsets ( ) )
2644 . listRowSeparator ( . hidden)
@@ -94,12 +112,15 @@ struct TransactionListView: View {
94112 viewModel: . init(
95113 bdkClient: . live
96114 ) ,
97- txDetails: txDetails
115+ txDetails: txDetails,
116+ fiatPrice: fiatPrice
98117 )
99118 ) {
100119 TransactionItemView (
101120 txDetails: txDetails,
102- isRedacted: false
121+ isRedacted: false ,
122+ format: format,
123+ fiatPrice: fiatPrice
103124 )
104125 }
105126
@@ -139,7 +160,9 @@ struct TransactionListView: View {
139160 transactions: [
140161 . mock
141162 ] ,
142- walletSyncState: . synced
163+ walletSyncState: . synced,
164+ format: . bip177,
165+ fiatPrice: 714.23
143166 )
144167 }
145168 #Preview {
@@ -148,7 +171,9 @@ struct TransactionListView: View {
148171 bdkClient: . mock
149172 ) ,
150173 transactions: [ ] ,
151- walletSyncState: . synced
174+ walletSyncState: . synced,
175+ format: . bip177,
176+ fiatPrice: 714.23
152177 )
153178 }
154179#endif
0 commit comments