diff --git a/BDKSwiftExampleWallet/Resources/Localizable.xcstrings b/BDKSwiftExampleWallet/Resources/Localizable.xcstrings index 8eedc6ea..bc97b415 100644 --- a/BDKSwiftExampleWallet/Resources/Localizable.xcstrings +++ b/BDKSwiftExampleWallet/Resources/Localizable.xcstrings @@ -754,6 +754,10 @@ } } }, + "Keep Kyoto open while it bootstraps." : { + "comment" : "A notice explaining that the user should keep Kyoto open while it bootstraps.", + "isCommentAutoGenerated" : true + }, "Kyoto" : { }, @@ -1268,6 +1272,10 @@ } } }, + "This one-time sync can take a few minutes." : { + "comment" : "A description of the time it takes to sync with Kyoto.", + "isCommentAutoGenerated" : true + }, "To" : { "extractionState" : "stale", "localizations" : { diff --git a/BDKSwiftExampleWallet/View/WalletView.swift b/BDKSwiftExampleWallet/View/WalletView.swift index 8df0b1d6..2299e8f1 100644 --- a/BDKSwiftExampleWallet/View/WalletView.swift +++ b/BDKSwiftExampleWallet/View/WalletView.swift @@ -56,6 +56,11 @@ struct WalletView: View { showAllTransactions = true } + if shouldShowKyotoInitialSyncNotice { + KyotoInitialSyncNoticeView(isConnected: viewModel.isKyotoConnected) + .transition(.opacity) + } + TransactionListView( viewModel: .init(), transactions: viewModel.recentTransactions, @@ -227,3 +232,40 @@ struct WalletView: View { ) } #endif + +extension WalletView { + fileprivate var shouldShowKyotoInitialSyncNotice: Bool { + viewModel.isKyotoClient + && viewModel.needsFullScan + && viewModel.walletSyncState == .syncing + } +} + +private struct KyotoInitialSyncNoticeView: View { + let isConnected: Bool + + var body: some View { + HStack(alignment: .top, spacing: 12) { + Image(systemName: "clock.arrow.circlepath") + .font(.title3) + .foregroundStyle(.orange) + + VStack(alignment: .leading, spacing: 4) { + Text( + "Keep Kyoto open while it bootstraps." + ) + .font(.subheadline) + .fontWeight(.semibold) + + Text( + "This one-time sync can take a few minutes." + ) + .font(.footnote) + .foregroundStyle(.secondary) + } + } + .padding() + .frame(maxWidth: .infinity, alignment: .leading) + .background(.thinMaterial, in: RoundedRectangle(cornerRadius: 16, style: .continuous)) + } +}