Merge branch 'main' of github.com:akatreyt/sportstime
This commit is contained in:
@@ -74,6 +74,7 @@ struct PaywallView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.storeButton(.visible, for: .restorePurchases)
|
.storeButton(.visible, for: .restorePurchases)
|
||||||
|
.storeButton(.visible, for: .redeemCode)
|
||||||
.subscriptionStoreControlStyle(.prominentPicker)
|
.subscriptionStoreControlStyle(.prominentPicker)
|
||||||
.subscriptionStoreButtonLabel(.displayName.multiline)
|
.subscriptionStoreButtonLabel(.displayName.multiline)
|
||||||
.onInAppPurchaseStart { product in
|
.onInAppPurchaseStart { product in
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
// SportsTime
|
// SportsTime
|
||||||
//
|
//
|
||||||
|
|
||||||
|
import StoreKit
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
struct SettingsView: View {
|
struct SettingsView: View {
|
||||||
@@ -11,6 +12,7 @@ struct SettingsView: View {
|
|||||||
@State private var viewModel = SettingsViewModel()
|
@State private var viewModel = SettingsViewModel()
|
||||||
@State private var showResetConfirmation = false
|
@State private var showResetConfirmation = false
|
||||||
@State private var showPaywall = false
|
@State private var showPaywall = false
|
||||||
|
@State private var showRedeemCode = false
|
||||||
@State private var showOnboardingPaywall = false
|
@State private var showOnboardingPaywall = false
|
||||||
@State private var showSyncLogs = false
|
@State private var showSyncLogs = false
|
||||||
@State private var isSyncActionInProgress = false
|
@State private var isSyncActionInProgress = false
|
||||||
@@ -79,6 +81,7 @@ struct SettingsView: View {
|
|||||||
.sheet(isPresented: $showPaywall) {
|
.sheet(isPresented: $showPaywall) {
|
||||||
PaywallView(source: "settings")
|
PaywallView(source: "settings")
|
||||||
}
|
}
|
||||||
|
.offerCodeRedemption(isPresented: $showRedeemCode)
|
||||||
.sheet(isPresented: $showOnboardingPaywall) {
|
.sheet(isPresented: $showOnboardingPaywall) {
|
||||||
OnboardingPaywallView(isPresented: $showOnboardingPaywall)
|
OnboardingPaywallView(isPresented: $showOnboardingPaywall)
|
||||||
}
|
}
|
||||||
@@ -812,6 +815,13 @@ struct SettingsView: View {
|
|||||||
Label("Restore Purchases", systemImage: "arrow.clockwise")
|
Label("Restore Purchases", systemImage: "arrow.clockwise")
|
||||||
}
|
}
|
||||||
.accessibilityIdentifier("settings.restorePurchasesButton")
|
.accessibilityIdentifier("settings.restorePurchasesButton")
|
||||||
|
|
||||||
|
Button {
|
||||||
|
showRedeemCode = true
|
||||||
|
} label: {
|
||||||
|
Label("Redeem Code", systemImage: "giftcard")
|
||||||
|
}
|
||||||
|
.accessibilityIdentifier("settings.redeemCodeButton")
|
||||||
}
|
}
|
||||||
} header: {
|
} header: {
|
||||||
Text("Subscription")
|
Text("Subscription")
|
||||||
|
|||||||
@@ -116,7 +116,8 @@ struct TeamPickerStep: View {
|
|||||||
.sheet(isPresented: $showTeamPicker) {
|
.sheet(isPresented: $showTeamPicker) {
|
||||||
TeamPickerSheet(
|
TeamPickerSheet(
|
||||||
selectedSport: $selectedSport,
|
selectedSport: $selectedSport,
|
||||||
selectedTeamId: $selectedTeamId
|
selectedTeamId: $selectedTeamId,
|
||||||
|
isPresented: $showTeamPicker
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -125,11 +126,11 @@ struct TeamPickerStep: View {
|
|||||||
// MARK: - Team Picker Sheet
|
// MARK: - Team Picker Sheet
|
||||||
|
|
||||||
private struct TeamPickerSheet: View {
|
private struct TeamPickerSheet: View {
|
||||||
@Environment(\.dismiss) private var dismiss
|
|
||||||
@Environment(\.colorScheme) private var colorScheme
|
@Environment(\.colorScheme) private var colorScheme
|
||||||
|
|
||||||
@Binding var selectedSport: Sport?
|
@Binding var selectedSport: Sport?
|
||||||
@Binding var selectedTeamId: String?
|
@Binding var selectedTeamId: String?
|
||||||
|
@Binding var isPresented: Bool
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
NavigationStack {
|
NavigationStack {
|
||||||
@@ -142,7 +143,7 @@ private struct TeamPickerSheet: View {
|
|||||||
onSelect: { teamId in
|
onSelect: { teamId in
|
||||||
selectedSport = sport
|
selectedSport = sport
|
||||||
selectedTeamId = teamId
|
selectedTeamId = teamId
|
||||||
dismiss()
|
isPresented = false
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
} label: {
|
} label: {
|
||||||
@@ -171,7 +172,7 @@ private struct TeamPickerSheet: View {
|
|||||||
.navigationBarTitleDisplayMode(.inline)
|
.navigationBarTitleDisplayMode(.inline)
|
||||||
.toolbar {
|
.toolbar {
|
||||||
ToolbarItem(placement: .cancellationAction) {
|
ToolbarItem(placement: .cancellationAction) {
|
||||||
Button("Cancel") { dismiss() }
|
Button("Cancel") { isPresented = false }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -115,7 +115,8 @@ struct TeamFirstWizardStep: View {
|
|||||||
.sheet(isPresented: $showTeamPicker) {
|
.sheet(isPresented: $showTeamPicker) {
|
||||||
TeamFirstPickerSheet(
|
TeamFirstPickerSheet(
|
||||||
selectedSport: $selectedSport,
|
selectedSport: $selectedSport,
|
||||||
selectedTeamIds: $selectedTeamIds
|
selectedTeamIds: $selectedTeamIds,
|
||||||
|
isPresented: $showTeamPicker
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -184,11 +185,11 @@ struct TeamFirstWizardStep: View {
|
|||||||
// MARK: - Team First Picker Sheet
|
// MARK: - Team First Picker Sheet
|
||||||
|
|
||||||
private struct TeamFirstPickerSheet: View {
|
private struct TeamFirstPickerSheet: View {
|
||||||
@Environment(\.dismiss) private var dismiss
|
|
||||||
@Environment(\.colorScheme) private var colorScheme
|
@Environment(\.colorScheme) private var colorScheme
|
||||||
|
|
||||||
@Binding var selectedSport: Sport?
|
@Binding var selectedSport: Sport?
|
||||||
@Binding var selectedTeamIds: Set<String>
|
@Binding var selectedTeamIds: Set<String>
|
||||||
|
@Binding var isPresented: Bool
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
NavigationStack {
|
NavigationStack {
|
||||||
@@ -200,7 +201,7 @@ private struct TeamFirstPickerSheet: View {
|
|||||||
selectedTeamIds: $selectedTeamIds,
|
selectedTeamIds: $selectedTeamIds,
|
||||||
onDone: {
|
onDone: {
|
||||||
selectedSport = sport
|
selectedSport = sport
|
||||||
dismiss()
|
isPresented = false
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
} label: {
|
} label: {
|
||||||
@@ -229,7 +230,7 @@ private struct TeamFirstPickerSheet: View {
|
|||||||
.navigationBarTitleDisplayMode(.inline)
|
.navigationBarTitleDisplayMode(.inline)
|
||||||
.toolbar {
|
.toolbar {
|
||||||
ToolbarItem(placement: .cancellationAction) {
|
ToolbarItem(placement: .cancellationAction) {
|
||||||
Button("Cancel") { dismiss() }
|
Button("Cancel") { isPresented = false }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -215,6 +215,7 @@ final class ScenarioCPlanner: ScenarioPlanner {
|
|||||||
from: gamesInRange,
|
from: gamesInRange,
|
||||||
stadiums: request.stadiums,
|
stadiums: request.stadiums,
|
||||||
anchorGameIds: [], // No anchors in Scenario C
|
anchorGameIds: [], // No anchors in Scenario C
|
||||||
|
allowRepeatCities: request.preferences.allowRepeatCities,
|
||||||
stopBuilder: buildStops
|
stopBuilder: buildStops
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user