From b1fd84fd75a2846c1512962c86a7da8fb0045aee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20D=E2=80=99Aquino?= Date: Fri, 18 Apr 2025 13:12:02 -0700 Subject: [PATCH] Add safety reminder for higher balances MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit adds a reminder to users who hold more than 100K sats in their NWC wallet, reminding them to learn about self-custody. Changelog-Added: Added safety reminder to wallets with higher balance Closes: https://github.com/damus-io/damus/issues/2984 Signed-off-by: Daniel D’Aquino --- damus/Views/Wallet/WalletView.swift | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/damus/Views/Wallet/WalletView.swift b/damus/Views/Wallet/WalletView.swift index 2dae3741..cf644623 100644 --- a/damus/Views/Wallet/WalletView.swift +++ b/damus/Views/Wallet/WalletView.swift @@ -7,6 +7,8 @@ import SwiftUI +let WALLET_WARNING_THRESHOLD: UInt64 = 100000 + struct WalletView: View { let damus_state: DamusState @State var show_settings: Bool = false @@ -22,6 +24,27 @@ struct WalletView: View { func MainWalletView(nwc: WalletConnectURL) -> some View { ScrollView { VStack(spacing: 35) { + if let balance = model.balance, balance > WALLET_WARNING_THRESHOLD { + VStack(spacing: 10) { + HStack { + Image(systemName: "exclamationmark.circle") + Text("Safety Reminder", comment: "Heading for a safety reminder that appears when the user has too many funds, recommending them to learn about safeguarding their funds.") + .font(.title3) + .bold() + } + .foregroundStyle(.damusWarningTertiary) + + Text("If your wallet balance is getting high, it's important to understand how to keep your funds secure. Please consider learning the best practices to ensure your assets remain safe. [Click here](https://damus.io/docs/wallet/high-balance-safety-reminder/) to learn more.", comment: "Text reminding the user has a high balance, recommending them to learn about self-custody") + .foregroundStyle(.damusWarningSecondary) + .opacity(0.8) + } + .padding() + .overlay( + RoundedRectangle(cornerRadius: 20) + .stroke(.damusWarningBorder, lineWidth: 1) + ) + } + VStack(spacing: 5) { BalanceView(balance: model.balance)