Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Sources/DashUIKit/Components/AddressFieldView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
4 changes: 3 additions & 1 deletion Sources/DashUIKit/Components/SearchBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
27 changes: 27 additions & 0 deletions Sources/DashUIKit/Components/Transaction/TransactionView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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)
}
Expand Down Expand Up @@ -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(
Expand Down
Loading