commit aeb1ee851d220de3b15397e23bf10f793f19da38
parent 6d0e7d17faf9eaf3444b5320cef919242a42b041
Author: Marc Stibane <marc@taler.net>
Date: Mon, 14 Sep 2026 10:56:42 +0200
onPrimary
Diffstat:
2 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/TalerCommon/Helper/WalletColors.swift b/TalerCommon/Helper/WalletColors.swift
@@ -143,6 +143,10 @@ public struct WalletColors {
Color("Taler")
}
+ var onPrimary: Color {
+ Color("OnPrimary")
+ }
+
func pendingColor(_ incoming: Bool) -> Color {
incoming ? primaryAccent // Color("PendingIncoming")
: .primary // Color("PendingOutgoing")
diff --git a/TalerWallet1/Views/Balances/DiscountPasses.swift b/TalerWallet1/Views/Balances/DiscountPasses.swift
@@ -57,6 +57,7 @@ struct DiscountsPassesItem: View {
let primary2 = WalletColors().primary2(colorScheme, colorSchemeContrast)
let secondary = WalletColors().secondary2(colorScheme, colorSchemeContrast)
let primaryAccent = WalletColors().primaryAccent
+ let onPrimary = WalletColors().onPrimary
let name = Text(token.name)
.talerFont(.title)
@@ -73,12 +74,18 @@ struct DiscountsPassesItem: View {
if let available = token.tokensAvailable {
// Discount
Text("x\(available)")
- .foregroundColor(primaryAccent)
+ .foregroundColor(isValid ? onPrimary : primaryAccent)
+ .padding(.horizontal, 8)
+ .padding(.vertical, 4)
+ .background(Capsule().fill(isValid ? primaryAccent : .clear))
} else {
// Pass
if isValid {
Text("active")
- .foregroundColor(primaryAccent)
+ .foregroundColor(onPrimary)
+ .padding(.horizontal, 8)
+ .padding(.vertical, 4)
+ .background(Capsule().fill(primaryAccent))
}
}
}
@@ -95,11 +102,11 @@ struct DiscountsPassesItem: View {
}.tint(WalletColors().negative)
row.swipeActions(edge: .trailing) { swipe }
}
- Divider()
+// Divider()
desc
.padding(.horizontal)
.padding(.vertical, 4)
- Divider()
+// Divider()
let merchant = token.merchantInfo?.name ?? "Unknown"
Text(isPass ? "Provided by: \(merchant)"
: !isExpired ? "Redeemable at: \(merchant)"