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>
32 lines
999 B
Swift
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)
|
|
}
|
|
}
|