Skip to content

Commit

Permalink
ui: send confirmation
Browse files Browse the repository at this point in the history
  • Loading branch information
reez authored Jan 22, 2024
1 parent a497752 commit db3a060
Showing 1 changed file with 27 additions and 26 deletions.
53 changes: 27 additions & 26 deletions LDKNodeMonday/View/Lightning/Send/SendConfirmationView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,33 +25,38 @@ struct SendConfirmationView: View {
Image(systemName: "bolt.fill")
.font(.largeTitle)
.foregroundColor(viewModel.networkColor)
HStack(alignment: .center) {
Text(viewModel.invoice)
.truncationMode(.middle)
.lineLimit(1)
.foregroundColor(.secondary)
.font(.subheadline)
Button {
UIPasteboard.general.string = viewModel.invoice
isCopied = true
showCheckmark = true
DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
isCopied = false
showCheckmark = false
}
} label: {
HStack {
withAnimation {
Image(systemName: showCheckmark ? "checkmark" : "doc.on.doc")

if let invoice = viewModel.invoice.bolt11amount(), let number = Int(invoice) {
HStack(alignment: .center) {
Text(viewModel.invoice)
.truncationMode(.middle)
.lineLimit(1)
.foregroundColor(.secondary)
.font(.subheadline)
Button {
UIPasteboard.general.string = viewModel.invoice
isCopied = true
showCheckmark = true
DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
isCopied = false
showCheckmark = false
}
} label: {
HStack {
withAnimation {
Image(
systemName: showCheckmark ? "checkmark" : "doc.on.doc"
)
.font(.subheadline)
}
}
.bold()
.foregroundColor(viewModel.networkColor)
}
.bold()
.foregroundColor(viewModel.networkColor)
}

}
.padding(.horizontal)
}
.padding(.horizontal)
}
.padding(.horizontal, 50.0)

Expand All @@ -62,10 +67,6 @@ struct SendConfirmationView: View {
Text("\(number.description.formattedAmount()) sats")
.font(.largeTitle)
.bold()
} else {
Image(systemName: "checkmark")
.foregroundColor(viewModel.networkColor)
.font(.subheadline)
}
Text(Date.now.formattedDate())
.foregroundColor(.secondary)
Expand Down

0 comments on commit db3a060

Please sign in to comment.