Skip to content

Commit fb18c27

Browse files
authored
ui: limit address characters max in buildtransactionview
1 parent e4ab965 commit fb18c27

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

BDKSwiftExampleWallet/View/Send/BuildTransactionView.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,12 @@ struct BuildTransactionView: View {
3333
HStack {
3434
Text("To")
3535
Spacer()
36-
Text(address)
37-
.lineLimit(1)
38-
.truncationMode(.middle)
39-
.frame(maxWidth: 100)
36+
Text(
37+
address.count > 10
38+
? "\(address.prefix(6))...\(address.suffix(4))" : address
39+
)
40+
.lineLimit(1)
41+
.truncationMode(.middle)
4042
}
4143
HStack {
4244
Text("Send")

0 commit comments

Comments
 (0)