Add safety reminder for higher balances
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 <daniel@daquino.me>
This commit is contained in:
@@ -7,6 +7,8 @@
|
|||||||
|
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
|
let WALLET_WARNING_THRESHOLD: UInt64 = 100000
|
||||||
|
|
||||||
struct WalletView: View {
|
struct WalletView: View {
|
||||||
let damus_state: DamusState
|
let damus_state: DamusState
|
||||||
@State var show_settings: Bool = false
|
@State var show_settings: Bool = false
|
||||||
@@ -22,6 +24,27 @@ struct WalletView: View {
|
|||||||
func MainWalletView(nwc: WalletConnectURL) -> some View {
|
func MainWalletView(nwc: WalletConnectURL) -> some View {
|
||||||
ScrollView {
|
ScrollView {
|
||||||
VStack(spacing: 35) {
|
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) {
|
VStack(spacing: 5) {
|
||||||
|
|
||||||
BalanceView(balance: model.balance)
|
BalanceView(balance: model.balance)
|
||||||
|
|||||||
Reference in New Issue
Block a user