@@ -25,6 +25,7 @@ extension String {
25
25
}
26
26
27
27
public struct AddressBookView : View {
28
+ @Environment ( \. colorScheme) private var colorScheme
28
29
@Perception . Bindable var store : StoreOf < AddressBook >
29
30
30
31
public init ( store: StoreOf < AddressBook > ) {
@@ -138,23 +139,23 @@ public struct AddressBookView: View {
138
139
ZStack {
139
140
Asset . Assets. send. image
140
141
. zImage ( size: 32 , style: Design . Btns. Tertiary. fg)
141
- . foregroundColor ( Design . Btns. Tertiary. fg. color )
142
+ . zForegroundColor ( Design . Btns. Tertiary. fg)
142
143
. background {
143
144
Circle ( )
144
- . fill ( Design . Btns. Tertiary. bg. color)
145
+ . fill ( Design . Btns. Tertiary. bg. color ( colorScheme ) )
145
146
. frame ( width: 72 , height: 72 )
146
147
}
147
148
148
149
ZcashSymbol ( )
149
150
. frame ( width: 24 , height: 24 )
150
- . foregroundColor ( Design . Surfaces. bgPrimary. color )
151
+ . zForegroundColor ( Design . Surfaces. bgPrimary)
151
152
. background {
152
153
Circle ( )
153
- . fill ( Design . Surfaces. brandBg. color)
154
+ . fill ( Design . Surfaces. brandBg. color ( colorScheme ) )
154
155
. frame ( width: 32 , height: 32 )
155
156
. background {
156
157
Circle ( )
157
- . fill ( Design . Surfaces. bgPrimary. color)
158
+ . fill ( Design . Surfaces. bgPrimary. color ( colorScheme ) )
158
159
. frame ( width: 36 , height: 36 )
159
160
}
160
161
}
@@ -175,23 +176,25 @@ public struct AddressBookView: View {
175
176
. listBackground ( )
176
177
177
178
ForEach ( store. walletAccounts, id: \. self) { walletAccount in
178
- VStack {
179
- walletAcoountView (
180
- icon: walletAccount. vendor. icon ( ) ,
181
- title: walletAccount. vendor. name ( ) ,
182
- address: walletAccount. unifiedAddress ?? L10n . Receive. Error. cantExtractUnifiedAddress
183
- ) {
184
- store. send ( . walletAccountTapped( walletAccount) )
185
- }
186
-
187
- if let last = store. walletAccounts. last, last != walletAccount {
188
- Design . Surfaces. divider. color
189
- . frame ( height: 1 )
190
- . padding ( . top, 12 )
191
- . padding ( . horizontal, 4 )
179
+ if walletAccount != store. selectedWalletAccount {
180
+ VStack {
181
+ walletAccountView (
182
+ icon: walletAccount. vendor. icon ( ) ,
183
+ title: walletAccount. vendor. name ( ) ,
184
+ address: walletAccount. unifiedAddress ?? L10n . Receive. Error. cantExtractUnifiedAddress
185
+ ) {
186
+ store. send ( . walletAccountTapped( walletAccount) )
187
+ }
188
+
189
+ if let last = store. walletAccounts. last, last != walletAccount {
190
+ Design . Surfaces. divider. color ( colorScheme)
191
+ . frame ( height: 1 )
192
+ . padding ( . top, 12 )
193
+ . padding ( . horizontal, 4 )
194
+ }
192
195
}
196
+ . listBackground ( )
193
197
}
194
- . listBackground ( )
195
198
}
196
199
197
200
if store. addressBookContacts. contacts. isEmpty {
@@ -209,7 +212,7 @@ public struct AddressBookView: View {
209
212
. padding ( . top, 70 )
210
213
. background {
211
214
RoundedRectangle ( cornerRadius: 16 )
212
- . stroke ( Design . Surfaces. strokeSecondary. color, style: StrokeStyle ( lineWidth: 2.0 , dash: [ 8 , 6 ] ) )
215
+ . stroke ( Design . Surfaces. strokeSecondary. color ( colorScheme ) , style: StrokeStyle ( lineWidth: 2.0 , dash: [ 8 , 6 ] ) )
213
216
}
214
217
. padding ( . top, 24 )
215
218
. screenHorizontalPadding ( )
@@ -234,7 +237,7 @@ public struct AddressBookView: View {
234
237
}
235
238
236
239
if let last = store. addressBookContacts. contacts. last, last != record {
237
- Design . Surfaces. divider. color
240
+ Design . Surfaces. divider. color ( colorScheme )
238
241
. frame ( height: 1 )
239
242
. padding ( . top, 12 )
240
243
. padding ( . horizontal, 4 )
@@ -249,37 +252,8 @@ public struct AddressBookView: View {
249
252
. background ( Asset . Colors. background. color)
250
253
. listStyle ( . plain)
251
254
}
252
-
253
- @ViewBuilder func walletAccountsList( ) -> some View {
254
- List {
255
- ForEach ( store. walletAccounts, id: \. self) { walletAccount in
256
- VStack {
257
- walletAcoountView (
258
- icon: walletAccount. vendor. icon ( ) ,
259
- title: walletAccount. vendor. name ( ) ,
260
- address: walletAccount. unifiedAddress ?? L10n . Receive. Error. cantExtractUnifiedAddress
261
- ) {
262
- store. send ( . walletAccountTapped( walletAccount) )
263
- }
264
-
265
- if let last = store. walletAccounts. last, last != walletAccount {
266
- Design . Surfaces. divider. color
267
- . frame ( height: 1 )
268
- . padding ( . top, 12 )
269
- . padding ( . horizontal, 4 )
270
- }
271
- }
272
- . listRowInsets ( EdgeInsets ( ) )
273
- . listRowBackground ( Asset . Colors. background. color)
274
- . listRowSeparator ( . hidden)
275
- }
276
- }
277
- . padding ( . vertical, 1 )
278
- . background ( Asset . Colors. background. color)
279
- . listStyle ( . plain)
280
- }
281
-
282
- @ViewBuilder func walletAcoountView(
255
+
256
+ @ViewBuilder func walletAccountView(
283
257
icon: Image ,
284
258
title: String ,
285
259
address: String ,
@@ -297,7 +271,7 @@ public struct AddressBookView: View {
297
271
. padding ( 8 )
298
272
. background {
299
273
Circle ( )
300
- . fill ( Design . Surfaces. bgAlt. color)
274
+ . fill ( Design . Surfaces. bgAlt. color ( colorScheme ) )
301
275
}
302
276
. padding ( . trailing, 12 )
303
277
@@ -319,7 +293,7 @@ public struct AddressBookView: View {
319
293
. background {
320
294
if selected {
321
295
RoundedRectangle ( cornerRadius: 16 )
322
- . fill ( Design . Surfaces. bgSecondary. color)
296
+ . fill ( Design . Surfaces. bgSecondary. color ( colorScheme ) )
323
297
}
324
298
}
325
299
}
0 commit comments