@@ -14,6 +14,7 @@ struct ActivityHomeHeaderView: View {
1414 let inspectedScripts : UInt64
1515 let totalScripts : UInt64
1616 let needsFullScan : Bool
17+ let syncMode : SyncMode
1718
1819 let showAllTransactions : ( ) -> Void
1920
@@ -24,60 +25,80 @@ struct ActivityHomeHeaderView: View {
2425
2526 HStack {
2627 if needsFullScan {
27- Text ( " \( inspectedScripts) " )
28- . padding ( . trailing, - 5.0 )
29- . fontWeight ( . semibold)
30- . contentTransition ( . numericText( ) )
31- . transition ( . opacity)
28+ if syncMode == . esplora {
29+ Text ( " \( inspectedScripts) " )
30+ . padding ( . trailing, - 5.0 )
31+ . fontWeight ( . semibold)
32+ . contentTransition ( . numericText( ) )
33+ . transition ( . opacity)
34+ . fontDesign ( . monospaced)
35+ . foregroundStyle ( . secondary)
36+ . font ( . caption2)
37+ . fontWeight ( . thin)
38+ . animation ( . easeInOut, value: inspectedScripts)
39+ } else if syncMode == . kyoto {
40+ CircularProgressView (
41+ progress: Float ( inspectedScripts) / Float( 100.0 )
42+ )
43+ . frame ( width: 30.0 , height: 30.0 )
44+ }
45+
46+ } else if walletSyncState == . syncing {
47+ if syncMode == . esplora {
48+ HStack {
49+ if progress < 1.0 {
50+ Text ( " \( inspectedScripts) " )
51+ . padding ( . trailing, - 5.0 )
52+ . fontWeight ( . semibold)
53+ . contentTransition ( . numericText( ) )
54+ . transition ( . opacity)
55+
56+ Text ( " / " )
57+ . padding ( . trailing, - 5.0 )
58+ . transition ( . opacity)
59+ Text ( " \( totalScripts) " )
60+ . contentTransition ( . numericText( ) )
61+ . transition ( . opacity)
62+ }
63+ Text (
64+ String (
65+ format: " %.0f%% " ,
66+ progress * 100
67+ )
68+ )
69+ . contentTransition ( . numericText( ) )
70+ . transition ( . opacity)
71+ }
3272 . fontDesign ( . monospaced)
3373 . foregroundStyle ( . secondary)
3474 . font ( . caption2)
3575 . fontWeight ( . thin)
3676 . animation ( . easeInOut, value: inspectedScripts)
37- } else if walletSyncState == . syncing {
38- HStack {
39- if progress < 1.0 {
40- Text ( " \( inspectedScripts) " )
41- . padding ( . trailing, - 5.0 )
42- . fontWeight ( . semibold)
43- . contentTransition ( . numericText( ) )
44- . transition ( . opacity)
45-
46- Text ( " / " )
47- . padding ( . trailing, - 5.0 )
48- . transition ( . opacity)
49- Text ( " \( totalScripts) " )
50- . contentTransition ( . numericText( ) )
51- . transition ( . opacity)
52- }
53-
54- Text (
55- String (
56- format: " %.0f%% " ,
57- progress * 100
58- )
59- )
60- . contentTransition ( . numericText( ) )
61- . transition ( . opacity)
77+ . animation ( . easeInOut, value: totalScripts)
78+ . animation ( . easeInOut, value: progress)
79+ } else if syncMode == . kyoto {
80+ Text ( " Conecting " )
81+ . font ( . caption)
82+ . foregroundStyle ( . secondary)
83+ . fontWeight ( . regular)
6284 }
63- . fontDesign ( . monospaced)
64- . foregroundStyle ( . secondary)
65- . font ( . caption2)
66- . fontWeight ( . thin)
67- . animation ( . easeInOut, value: inspectedScripts)
68- . animation ( . easeInOut, value: totalScripts)
69- . animation ( . easeInOut, value: progress)
7085 }
7186 }
72- HStack {
73- HStack ( spacing: 5 ) {
74- self . syncImageIndicator ( )
75- }
76- . contentTransition ( . symbolEffect( . replace. offUp) )
87+ switch syncMode {
88+ case . esplora:
89+ HStack {
90+ HStack ( spacing: 5 ) {
91+ self . syncImageIndicator ( )
92+ }
93+ . contentTransition ( . symbolEffect( . replace. offUp) )
7794
95+ }
96+ . foregroundStyle ( . secondary)
97+ . font ( . caption)
98+
99+ case . kyoto:
100+ EmptyView ( )
78101 }
79- . foregroundStyle ( . secondary)
80- . font ( . caption)
81102
82103 if walletSyncState == . synced {
83104 Button {
0 commit comments