fix: resolve ambiguous color references by removing ShapeStyle extension

The ShapeStyle where Self == Color extension duplicated Color statics,
causing 'ambiguous use' errors in foregroundStyle/stroke/tint/background
contexts. Removed the extension entirely and use explicit Color.xxx prefix
at all call sites instead.
This commit is contained in:
Schwifty 2026-03-22 19:40:51 +00:00
parent 3fbb44d22c
commit 09db3e8ec7
6 changed files with 14 additions and 24 deletions

View file

@ -4,16 +4,6 @@ import SwiftUI
/// Primary: #22B24B (Payfrit Green)
/// Dark: #1A8A3A
// MARK: - ShapeStyle convenience (resolves ambiguous dot-syntax in foregroundStyle/background)
extension ShapeStyle where Self == Color {
static var warningOrange: Color { Color.warningOrange }
static var errorRed: Color { Color.errorRed }
static var successGreen: Color { Color.successGreen }
static var infoBlue: Color { Color.infoBlue }
static var payfritGreen: Color { Color.payfritGreen }
static var payfritGreenDark: Color { Color.payfritGreenDark }
}
extension Color {
// MARK: - Brand
static let payfritGreen = Color(red: 0x22/255.0, green: 0xB2/255.0, blue: 0x4B/255.0)

View file

@ -26,7 +26,7 @@ struct BusinessListView: View {
VStack(spacing: 12) {
Image(systemName: "exclamationmark.triangle")
.font(.system(size: 48))
.foregroundStyle(.warningOrange)
.foregroundStyle(Color.warningOrange)
Text("Error")
.font(.headline)
Text(error)

View file

@ -8,7 +8,7 @@ struct DevBanner: View {
.foregroundStyle(.white)
.padding(.horizontal, 12)
.padding(.vertical, 4)
.background(.warningOrange, in: Capsule())
.background(Color.warningOrange, in: Capsule())
.padding(.top, 4)
}
}

View file

@ -20,7 +20,7 @@ struct LoginView: View {
// Logo
Image(systemName: "antenna.radiowaves.left.and.right")
.font(.system(size: 64))
.foregroundStyle(.payfritGreen)
.foregroundStyle(Color.payfritGreen)
Text("Payfrit Beacon")
.font(.title.bold())
@ -49,7 +49,7 @@ struct LoginView: View {
if let error = errorMessage {
Text(error)
.font(.caption)
.foregroundStyle(.errorRed)
.foregroundStyle(Color.errorRed)
}
Button(action: handleAction) {

View file

@ -101,7 +101,7 @@ struct QRScannerView: View {
p.addLine(to: CGPoint(x: 0, y: 0))
p.addLine(to: CGPoint(x: corner, y: 0))
}
.stroke(.payfritGreen, lineWidth: thickness)
.stroke(Color.payfritGreen, lineWidth: thickness)
// Top-right
Path { p in
@ -109,7 +109,7 @@ struct QRScannerView: View {
p.addLine(to: CGPoint(x: w, y: 0))
p.addLine(to: CGPoint(x: w, y: corner))
}
.stroke(.payfritGreen, lineWidth: thickness)
.stroke(Color.payfritGreen, lineWidth: thickness)
// Bottom-left
Path { p in
@ -117,7 +117,7 @@ struct QRScannerView: View {
p.addLine(to: CGPoint(x: 0, y: h))
p.addLine(to: CGPoint(x: corner, y: h))
}
.stroke(.payfritGreen, lineWidth: thickness)
.stroke(Color.payfritGreen, lineWidth: thickness)
// Bottom-right
Path { p in
@ -125,7 +125,7 @@ struct QRScannerView: View {
p.addLine(to: CGPoint(x: w, y: h))
p.addLine(to: CGPoint(x: w, y: h - corner))
}
.stroke(.payfritGreen, lineWidth: thickness)
.stroke(Color.payfritGreen, lineWidth: thickness)
}
}

View file

@ -174,7 +174,7 @@ struct ScanView: View {
VStack(spacing: 12) {
Image(systemName: "exclamationmark.triangle")
.font(.system(size: 48))
.foregroundStyle(.warningOrange)
.foregroundStyle(Color.warningOrange)
Text("Namespace Error")
.font(.headline)
Text(errorMessage ?? "Failed to allocate beacon namespace")
@ -240,7 +240,7 @@ struct ScanView: View {
if bleManager.bluetoothState != .poweredOn {
Label("Bluetooth Off", systemImage: "bluetooth.slash")
.font(.caption)
.foregroundStyle(.errorRed)
.foregroundStyle(Color.errorRed)
}
}
.padding(.horizontal)
@ -323,7 +323,7 @@ struct ScanView: View {
Image(systemName: "light.beacon.max")
.font(.system(size: 64))
.foregroundStyle(.payfritGreen)
.foregroundStyle(Color.payfritGreen)
.modifier(PulseEffectModifier())
Text("Beacon is Flashing")
@ -345,7 +345,7 @@ struct ScanView: View {
.frame(maxWidth: .infinity)
}
.buttonStyle(.borderedProminent)
.tint(.payfritGreen)
.tint(Color.payfritGreen)
.controlSize(.large)
.padding(.horizontal, 32)
@ -379,7 +379,7 @@ struct ScanView: View {
Spacer()
Image(systemName: "checkmark.circle.fill")
.font(.system(size: 64))
.foregroundStyle(.successGreen)
.foregroundStyle(Color.successGreen)
Text("Beacon Provisioned!")
.font(.title2.bold())
Text(statusMessage)
@ -400,7 +400,7 @@ struct ScanView: View {
Spacer()
Image(systemName: "xmark.circle.fill")
.font(.system(size: 64))
.foregroundStyle(.errorRed)
.foregroundStyle(Color.errorRed)
Text("Provisioning Failed")
.font(.title2.bold())
Text(errorMessage ?? "Unknown error")