Show Monero accounts as their own section below the wallet card

This commit is contained in:
2026-10-11 19:22:21 +08:00
parent c9679e35c4
commit e67ed9e063
+26 -25
View File
@@ -177,38 +177,39 @@ struct HomeView: View {
Spacer() Spacer()
} }
if model.chain == .xmr, !model.moneroAccounts.isEmpty { VStack(alignment: .leading, spacing: 4) {
// Cake Wallet style: a deck of account cards, drag the front card Text("Balance")
// away to bring the next one up. .font(.system(size: 11, weight: .medium))
AccountStack(accounts: model.moneroAccounts, .foregroundStyle(Theme.muted)
fiat: { model.fiatValue(of: $0, chain: .xmr) }, Text("\(model.balance.total) \(model.symbol)")
onQR: { qrAddress = AddressQR(title: $0.title, address: $0.address) }) .font(.system(size: 30, weight: .bold, design: .rounded))
} else { .foregroundStyle(Theme.text)
VStack(alignment: .leading, spacing: 4) { if let fiat = model.fiatBalance {
Text("Balance") Text("\(fiat)")
.font(.system(size: 11, weight: .medium)) .font(.system(size: 13, weight: .medium))
.foregroundStyle(Theme.muted)
}
if model.chain == .xmr, model.balance.unlocked != model.balance.total {
Text("\(model.balance.unlocked) \(model.symbol) unlocked")
.font(.system(size: 11))
.foregroundStyle(Theme.muted) .foregroundStyle(Theme.muted)
Text("\(model.balance.total) \(model.symbol)")
.font(.system(size: 30, weight: .bold, design: .rounded))
.foregroundStyle(Theme.text)
if let fiat = model.fiatBalance {
Text("\(fiat)")
.font(.system(size: 13, weight: .medium))
.foregroundStyle(Theme.muted)
}
if model.chain == .xmr, model.balance.unlocked != model.balance.total {
Text("\(model.balance.unlocked) \(model.symbol) unlocked")
.font(.system(size: 11))
.foregroundStyle(Theme.muted)
}
} }
AddressRow(address: model.displayAddress)
} }
if model.chain == .xrp {
AddressRow(address: model.displayAddress)
}
} }
} }
if model.chain == .xmr, !model.moneroAccounts.isEmpty {
// Cake Wallet style: a deck of account cards as its own section, drag
// the front card away to bring the next one up.
AccountStack(accounts: model.moneroAccounts,
fiat: { model.fiatValue(of: $0, chain: .xmr) },
onQR: { qrAddress = AddressQR(title: $0.title, address: $0.address) })
}
if model.chain == .xmr { if model.chain == .xmr {
SyncCard() SyncCard()
} }