Skip to content

Commit 012f654

Browse files
committed
AddressViewer: turncate address display like in android
1 parent 8f706b4 commit 012f654

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

Bitkit/Views/Settings/Advanced/AddressViewer.swift

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -373,18 +373,12 @@ struct AddressRow: View {
373373

374374
var body: some View {
375375
HStack(spacing: 12) {
376-
// Index
377376
CaptionText(
378-
"\(index):",
379-
textColor: isSelected ? .white : .white80
380-
)
381-
382-
// Address (truncated)
383-
CaptionText(
384-
truncatedAddress,
377+
"\(index): \(address)",
385378
textColor: isSelected ? .white : .textPrimary
386379
)
387380
.lineLimit(1)
381+
.truncationMode(.middle)
388382

389383
Spacer()
390384

@@ -410,13 +404,7 @@ struct AddressRow: View {
410404
Haptics.play(.copiedToClipboard)
411405
app.toast(type: .success, title: t("common__copied"), description: address)
412406
}
413-
}
414-
415-
private var truncatedAddress: String {
416-
guard address.count > 20 else { return address }
417-
let start = String(address.prefix(12))
418-
let end = String(address.suffix(12))
419-
return "\(start)...\(end)"
407+
.accessibilityIdentifier("Address-\(index)")
420408
}
421409
}
422410

0 commit comments

Comments
 (0)