diff --git a/Sources/DashUIKit/Components/AddressFieldView.swift b/Sources/DashUIKit/Components/AddressFieldView.swift index db53e1a..0278960 100644 --- a/Sources/DashUIKit/Components/AddressFieldView.swift +++ b/Sources/DashUIKit/Components/AddressFieldView.swift @@ -121,8 +121,10 @@ public struct AddressFieldView: View { TextField( "", text: $text, + // A prompt must stay a `Text`; `dashFont` returns `some View`, and a + // line height cannot be applied to `Text` anyway. prompt: Text(placeholder) - .dashFont(.subhead) + .font(Font.dash.subhead) .foregroundStyle(Color.dash.black1000Alpha30), axis: .vertical ) diff --git a/Sources/DashUIKit/Components/SearchBar.swift b/Sources/DashUIKit/Components/SearchBar.swift index 3f5471a..7614b08 100644 --- a/Sources/DashUIKit/Components/SearchBar.swift +++ b/Sources/DashUIKit/Components/SearchBar.swift @@ -141,8 +141,10 @@ private struct SearchBarFocused: View { if #available(iOS 17.0, *) { TextField( text: $text, + // A prompt must stay a `Text`; `dashFont` returns `some View`, and a + // line height cannot be applied to `Text` anyway. prompt: Text(placeholder) - .dashFont(.subhead) + .font(Font.dash.subhead) .foregroundStyle(Color.dash.black1000Alpha30) ) { EmptyView() diff --git a/Sources/DashUIKit/Components/Transaction/TransactionView.swift b/Sources/DashUIKit/Components/Transaction/TransactionView.swift index 9050d45..4b63182 100644 --- a/Sources/DashUIKit/Components/Transaction/TransactionView.swift +++ b/Sources/DashUIKit/Components/Transaction/TransactionView.swift @@ -60,6 +60,10 @@ public struct TransactionView: View { /// Dash amount in duffs (10⁸ per Dash). Negative = outgoing. public var dashAmount: Int64 public var amountSign: DashAmountSign + /// Optional SF Symbol rendered immediately before the amount, in the secondary tone. + /// Meant for rows whose amount carries no direction — e.g. a circulating-arrows glyph on a + /// wallet-internal transfer shown with `amountSign: .none`. + public var amountAccessorySystemImage: String? public var fiat: String? /// Short status shown immediately before the amount, e.g. "Locked" for a coinbase reward that /// has not matured yet. Rendered in the warning tone, since it qualifies the amount. @@ -78,6 +82,7 @@ public struct TransactionView: View { details: String? = nil, dashAmount: Int64 = 0, amountSign: DashAmountSign = .negativeOnly, + amountAccessorySystemImage: String? = nil, fiat: String? = nil, trailingStatusText: String? = nil, action: (() -> Void)? = nil @@ -91,6 +96,7 @@ public struct TransactionView: View { self.details = details self.dashAmount = dashAmount self.amountSign = amountSign + self.amountAccessorySystemImage = amountAccessorySystemImage self.fiat = fiat self.trailingStatusText = trailingStatusText self.action = action @@ -209,6 +215,12 @@ public struct TransactionView: View { .foregroundColor(Color.dash.orange) } + if let amountAccessorySystemImage { + Image(systemName: amountAccessorySystemImage) + .font(.system(size: 11, weight: .semibold)) + .foregroundColor(Color.dash.secondaryText) + } + DashAmount(amount: dashAmount, sign: amountSign) .foregroundColor(Color.dash.primaryText) } @@ -270,6 +282,21 @@ public struct TransactionView: View { .background(Color.dash.primaryBackground) } +@available(iOS 17, macOS 14, *) +#Preview("Internal transfer — amount accessory") { + TransactionView( + icon: .system("arrow.forward.circle.fill"), + title: "Internal Transfer", + subtitle: "8:34 AM", + dashAmount: 200_000_000, + amountSign: .none, + amountAccessorySystemImage: "arrow.triangle.2.circlepath", + fiat: "$ 55.00" + ) + .padding(.horizontal) + .background(Color.dash.primaryBackground) +} + @available(iOS 17, macOS 14, *) #Preview("Locked reward") { TransactionView(