diff --git a/Bitkit/Components/IncomingTransfer.swift b/Bitkit/Components/IncomingTransfer.swift index 551a8f53..57845941 100644 --- a/Bitkit/Components/IncomingTransfer.swift +++ b/Bitkit/Components/IncomingTransfer.swift @@ -8,24 +8,18 @@ struct IncomingTransfer: View { @EnvironmentObject var currency: CurrencyViewModel var body: some View { - HStack(spacing: 4) { - Image("transfer") + HStack(spacing: 0) { + Image("arrow-up-down") .resizable() .frame(width: 16, height: 16) - .foregroundColor(.white64) + .foregroundColor(.textSecondary) + .padding(.trailing, 3) - CaptionBText( - t("wallet__details_transfer_subtitle"), - textColor: .white64 - ) + CaptionBText(t("wallet__details_transfer_subtitle")) if let converted = currency.convert(sats: amount) { let formattedAmount = formatAmount(converted) - CaptionBText( - formattedAmount, - textColor: .white64, - accentColor: .white64 - ) + CaptionBText(formattedAmount) } } } diff --git a/Bitkit/Components/RectangleButton.swift b/Bitkit/Components/RectangleButton.swift index f208a20d..25771ea2 100644 --- a/Bitkit/Components/RectangleButton.swift +++ b/Bitkit/Components/RectangleButton.swift @@ -73,6 +73,6 @@ struct RectangleButton: View { } private var backgroundColor: Color { - return isPressed ? .gray5 : .gray6 + return isPressed && !isDisabled ? .gray5 : .gray6 } } diff --git a/Bitkit/Views/Wallets/Receive/ReceiveCjitGeoBlocked.swift b/Bitkit/Views/Wallets/Receive/ReceiveCjitGeoBlocked.swift new file mode 100644 index 00000000..cb1bf6b5 --- /dev/null +++ b/Bitkit/Views/Wallets/Receive/ReceiveCjitGeoBlocked.swift @@ -0,0 +1,33 @@ +import SwiftUI + +struct ReceiveCjitGeoBlocked: View { + @EnvironmentObject private var navigation: NavigationViewModel + @EnvironmentObject private var sheets: SheetViewModel + + var body: some View { + VStack(alignment: .leading, spacing: 0) { + SheetHeader(title: t("wallet__receive_bitcoin"), showBackButton: true) + + BodyMText(t("lightning__funding__text_blocked_cjit")) + + Spacer() + + Image("globe-sphere") + .resizable() + .aspectRatio(contentMode: .fit) + .frame(width: 256, height: 256) + .padding() + .frame(maxWidth: .infinity, maxHeight: .infinity) + + Spacer() + + CustomButton(title: tTodo("Advanced Setup")) { + sheets.hideSheet() + navigation.navigate(.fundingAdvanced) + } + } + .navigationBarHidden(true) + .padding(.horizontal, 16) + .sheetBackground() + } +} diff --git a/Bitkit/Views/Wallets/Receive/ReceiveQr.swift b/Bitkit/Views/Wallets/Receive/ReceiveQr.swift index a88f0e09..c1e415e2 100644 --- a/Bitkit/Views/Wallets/Receive/ReceiveQr.swift +++ b/Bitkit/Views/Wallets/Receive/ReceiveQr.swift @@ -110,11 +110,7 @@ struct ReceiveQr: View { isDisabled: wallet.nodeLifecycleState != .running ) { if GeoService.shared.isGeoBlocked && !wallet.hasNonLspChannels() { - app.toast( - type: .error, - title: "Instant Payments Unavailable", - description: "Bitkit does not provide Lightning services in your country, but you can still connect to other nodes." - ) + navigationPath.append(.cjitGeoBlocked) } else { navigationPath.append(.cjitAmount) } @@ -149,7 +145,7 @@ struct ReceiveQr: View { } catch { app.toast(error) } - try? await app.checkGeoStatus() + await app.checkGeoStatus() } .onChange(of: wallet.nodeLifecycleState) { newState in // They may open this view before node has started @@ -164,7 +160,7 @@ struct ReceiveQr: View { @ViewBuilder func tabContent(for tab: ReceiveTab) -> some View { VStack(spacing: 0) { - if showingCjitOnboarding { + if tab == .spending && wallet.channelCount == 0 && cjitInvoice == nil { cjitOnboarding } else if showDetails { detailsContent(for: tab) diff --git a/Bitkit/Views/Wallets/Receive/ReceiveSheet.swift b/Bitkit/Views/Wallets/Receive/ReceiveSheet.swift index 4d63aa60..9cf6a790 100644 --- a/Bitkit/Views/Wallets/Receive/ReceiveSheet.swift +++ b/Bitkit/Views/Wallets/Receive/ReceiveSheet.swift @@ -8,6 +8,7 @@ enum ReceiveRoute: Hashable { case cjitAmount case cjitConfirm(entry: IcJitEntry, receiveAmountSats: UInt64, isAdditional: Bool) case cjitLearnMore(entry: IcJitEntry, receiveAmountSats: UInt64, isAdditional: Bool) + case cjitGeoBlocked } struct ReceiveConfig { @@ -72,6 +73,8 @@ struct ReceiveSheet: View { ReceiveCjitConfirmation(navigationPath: $navigationPath, entry: entry, receiveAmountSats: receiveAmountSats, isAdditional: isAdditional) case let .cjitLearnMore(entry, receiveAmountSats, isAdditional): ReceiveCjitLearnMore(entry: entry, receiveAmountSats: receiveAmountSats, isAdditional: isAdditional) + case .cjitGeoBlocked: + ReceiveCjitGeoBlocked() } } }