Skip to content

Commit 5e0ae92

Browse files
authored
feat: kyoto bootstrap view
1 parent 9e72529 commit 5e0ae92

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

BDKSwiftExampleWallet/Resources/Localizable.xcstrings

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,10 @@
754754
}
755755
}
756756
},
757+
"Keep Kyoto open while it bootstraps." : {
758+
"comment" : "A notice explaining that the user should keep Kyoto open while it bootstraps.",
759+
"isCommentAutoGenerated" : true
760+
},
757761
"Kyoto" : {
758762

759763
},
@@ -1268,6 +1272,10 @@
12681272
}
12691273
}
12701274
},
1275+
"This one-time sync can take a few minutes." : {
1276+
"comment" : "A description of the time it takes to sync with Kyoto.",
1277+
"isCommentAutoGenerated" : true
1278+
},
12711279
"To" : {
12721280
"extractionState" : "stale",
12731281
"localizations" : {

BDKSwiftExampleWallet/View/WalletView.swift

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ struct WalletView: View {
5656
showAllTransactions = true
5757
}
5858

59+
if shouldShowKyotoInitialSyncNotice {
60+
KyotoInitialSyncNoticeView(isConnected: viewModel.isKyotoConnected)
61+
.transition(.opacity)
62+
}
63+
5964
TransactionListView(
6065
viewModel: .init(),
6166
transactions: viewModel.recentTransactions,
@@ -227,3 +232,40 @@ struct WalletView: View {
227232
)
228233
}
229234
#endif
235+
236+
extension WalletView {
237+
fileprivate var shouldShowKyotoInitialSyncNotice: Bool {
238+
viewModel.isKyotoClient
239+
&& viewModel.needsFullScan
240+
&& viewModel.walletSyncState == .syncing
241+
}
242+
}
243+
244+
private struct KyotoInitialSyncNoticeView: View {
245+
let isConnected: Bool
246+
247+
var body: some View {
248+
HStack(alignment: .top, spacing: 12) {
249+
Image(systemName: "clock.arrow.circlepath")
250+
.font(.title3)
251+
.foregroundStyle(.orange)
252+
253+
VStack(alignment: .leading, spacing: 4) {
254+
Text(
255+
"Keep Kyoto open while it bootstraps."
256+
)
257+
.font(.subheadline)
258+
.fontWeight(.semibold)
259+
260+
Text(
261+
"This one-time sync can take a few minutes."
262+
)
263+
.font(.footnote)
264+
.foregroundStyle(.secondary)
265+
}
266+
}
267+
.padding()
268+
.frame(maxWidth: .infinity, alignment: .leading)
269+
.background(.thinMaterial, in: RoundedRectangle(cornerRadius: 16, style: .continuous))
270+
}
271+
}

0 commit comments

Comments
 (0)