- Add VoiceOver labels, hints, and element grouping across all 60+ views - Add Reduce Motion support (Theme.Animation.prefersReducedMotion) to all animations - Replace fixed font sizes with semantic Dynamic Type styles - Hide decorative elements from VoiceOver with .accessibilityHidden(true) - Add .minimumHitTarget() modifier ensuring 44pt touch targets - Add AccessibilityAnnouncer utility for VoiceOver announcements - Improve color contrast values in Theme.swift for WCAG AA compliance - Extract CloudKitContainerConfig for explicit container identity - Remove PostHog debug console log from AnalyticsManager Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
48 lines
1.0 KiB
Swift
48 lines
1.0 KiB
Swift
//
|
|
// ProBadge.swift
|
|
// SportsTime
|
|
//
|
|
// Small "PRO" badge indicator for locked features.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct ProBadge: View {
|
|
var body: some View {
|
|
Text("PRO")
|
|
.font(.caption2.bold())
|
|
.foregroundStyle(.white)
|
|
.padding(.horizontal, 6)
|
|
.padding(.vertical, 2)
|
|
.background(Theme.warmOrange, in: Capsule())
|
|
.accessibilityLabel("Pro feature")
|
|
}
|
|
}
|
|
|
|
// MARK: - View Modifier
|
|
|
|
extension View {
|
|
/// Adds a small PRO badge overlay to indicate locked feature
|
|
func proBadge(alignment: Alignment = .topTrailing) -> some View {
|
|
overlay(alignment: alignment) {
|
|
if !StoreManager.shared.isPro {
|
|
ProBadge()
|
|
.padding(4)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
#Preview {
|
|
VStack(spacing: 20) {
|
|
ProBadge()
|
|
|
|
// Example usage
|
|
RoundedRectangle(cornerRadius: 12)
|
|
.fill(.blue.opacity(0.2))
|
|
.frame(width: 100, height: 60)
|
|
.proBadge()
|
|
}
|
|
.padding()
|
|
}
|