Show live swap status, explorer links, and full kyc.rip route details
This commit is contained in:
@@ -51,6 +51,26 @@ struct SecondaryButton: View {
|
||||
}
|
||||
}
|
||||
|
||||
/// A full-width button that opens a web page, styled like SecondaryButton.
|
||||
struct LinkButton: View {
|
||||
var title: String
|
||||
var systemImage: String = "safari"
|
||||
var url: URL
|
||||
|
||||
var body: some View {
|
||||
Link(destination: url) {
|
||||
Label(title, systemImage: systemImage)
|
||||
.font(.system(size: 15, weight: .medium))
|
||||
.frame(maxWidth: .infinity)
|
||||
.padding(.vertical, 14)
|
||||
.background(Theme.surface)
|
||||
.foregroundStyle(Theme.text)
|
||||
.overlay(RoundedRectangle(cornerRadius: 14, style: .continuous).stroke(Theme.border))
|
||||
.clipShape(RoundedRectangle(cornerRadius: 14, style: .continuous))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct Card<Content: View>: View {
|
||||
@ViewBuilder var content: Content
|
||||
|
||||
@@ -146,6 +166,54 @@ struct ChainPicker: View {
|
||||
}
|
||||
}
|
||||
|
||||
/// Picks which Monero account a payment leaves from. Each account has its own
|
||||
/// balance, so "Max" and the wallet's spend checks need the matching index.
|
||||
struct MoneroAccountPicker: View {
|
||||
var accounts: [MoneroAccount]
|
||||
@Binding var selection: Int
|
||||
var onSelect: (() -> Void)?
|
||||
|
||||
private var selected: MoneroAccount? {
|
||||
accounts.first(where: { $0.index == selection }) ?? accounts.first
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .leading, spacing: 6) {
|
||||
FieldLabel(text: "Send from")
|
||||
Menu {
|
||||
ForEach(accounts) { account in
|
||||
Button {
|
||||
selection = account.index
|
||||
onSelect?()
|
||||
} label: {
|
||||
Text("\(account.title) · \(account.balance) XMR")
|
||||
}
|
||||
}
|
||||
} label: {
|
||||
HStack(spacing: 10) {
|
||||
VStack(alignment: .leading, spacing: 2) {
|
||||
Text(selected?.title ?? "Primary account")
|
||||
.font(.system(size: 15, weight: .medium))
|
||||
.foregroundStyle(Theme.text)
|
||||
Text("\(selected?.unlocked ?? "0") XMR available")
|
||||
.font(.system(size: 11))
|
||||
.foregroundStyle(Theme.muted)
|
||||
}
|
||||
Spacer()
|
||||
Image(systemName: "chevron.up.chevron.down")
|
||||
.font(.system(size: 12, weight: .semibold))
|
||||
.foregroundStyle(Theme.muted)
|
||||
}
|
||||
.padding(.horizontal, 14)
|
||||
.padding(.vertical, 12)
|
||||
.background(Theme.surface)
|
||||
.overlay(RoundedRectangle(cornerRadius: 14, style: .continuous).stroke(Theme.border))
|
||||
.clipShape(RoundedRectangle(cornerRadius: 14, style: .continuous))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct QRCodeView: View {
|
||||
var text: String
|
||||
|
||||
|
||||
Reference in New Issue
Block a user