Files
MatchLiveTv/native/ios/MatchLiveTv/UI/Components/MatchPrimaryButton.swift
T
Emiliano FrascaroandCursor 45bdda7c95 Semplifica la home partite a un solo CTA e sistema la nav iOS.
Rimuove il pulsante ridondante «Partita programmata», migliora il padding dei bottoni e fa di splash/login/matches root vere così non compare più il chevron indietro spurio.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-08 18:54:44 +02:00

32 lines
999 B
Swift

import SwiftUI
struct MatchPrimaryButton: View {
let label: String
let action: () -> Void
var enabled: Bool = true
var loading: Bool = false
var body: some View {
Button(action: action) {
Group {
if loading {
ProgressView()
.tint(.white)
} else {
Text(label)
.font(MatchTypography.labelLarge)
.lineLimit(1)
.minimumScaleFactor(0.7)
.padding(.horizontal, 14)
}
}
.frame(maxWidth: .infinity)
.frame(height: 52)
}
.buttonStyle(.plain)
.background(enabled && !loading ? MatchColors.primaryRed : MatchColors.surfaceElevated, in: RoundedRectangle(cornerRadius: 8))
.foregroundStyle(enabled && !loading ? .white : MatchColors.textSecondary)
.disabled(!enabled || loading)
}
}