|
|
|
@ -15,6 +15,12 @@ struct ToolboxView: View { |
|
|
|
@Environment(NavigationViewModel.self) private var navigation: NavigationViewModel |
|
|
|
@Environment(NavigationViewModel.self) private var navigation: NavigationViewModel |
|
|
|
@State private var didResetApiCalls: Bool = false |
|
|
|
@State private var didResetApiCalls: Bool = false |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@State var showDebugViews: Bool = false |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@State private var tapCount = 0 |
|
|
|
|
|
|
|
@State private var lastTapTime: Date? = nil |
|
|
|
|
|
|
|
private let tapTimeThreshold: TimeInterval = 1.0 |
|
|
|
|
|
|
|
|
|
|
|
var lastDataSource: String? { |
|
|
|
var lastDataSource: String? { |
|
|
|
dataStore.appSettings.lastDataSource |
|
|
|
dataStore.appSettings.lastDataSource |
|
|
|
} |
|
|
|
} |
|
|
|
@ -39,25 +45,21 @@ struct ToolboxView: View { |
|
|
|
.contextMenu { |
|
|
|
.contextMenu { |
|
|
|
ShareLink(item: URLs.main.url) |
|
|
|
ShareLink(item: URLs.main.url) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
SupportButtonView(contentIsUnavailable: false) |
|
|
|
SupportButtonView(contentIsUnavailable: false) |
|
|
|
|
|
|
|
|
|
|
|
Link(destination: URLs.appReview.url) { |
|
|
|
Link(destination: URLs.appReview.url) { |
|
|
|
Text("Partagez vos impressions !") |
|
|
|
Text("Partagez vos impressions !") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Link(destination: URLs.instagram.url) { |
|
|
|
Link(destination: URLs.instagram.url) { |
|
|
|
Text("Compte Instagram PadelClub.app") |
|
|
|
Text("Compte Instagram PadelClub.app") |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#if DEBUG |
|
|
|
if showDebugViews { |
|
|
|
DebugView() |
|
|
|
DebugView() |
|
|
|
#endif |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#if TESTFLIGHT |
|
|
|
|
|
|
|
DebugView() |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Section { |
|
|
|
Section { |
|
|
|
NavigationLink { |
|
|
|
NavigationLink { |
|
|
|
@ -65,7 +67,7 @@ struct ToolboxView: View { |
|
|
|
} label: { |
|
|
|
} label: { |
|
|
|
Label("Rechercher un joueur", systemImage: "person.fill.viewfinder") |
|
|
|
Label("Rechercher un joueur", systemImage: "person.fill.viewfinder") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
NavigationLink { |
|
|
|
NavigationLink { |
|
|
|
RankCalculatorView() |
|
|
|
RankCalculatorView() |
|
|
|
} label: { |
|
|
|
} label: { |
|
|
|
@ -113,13 +115,13 @@ struct ToolboxView: View { |
|
|
|
didResetApiCalls = true |
|
|
|
didResetApiCalls = true |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Section { |
|
|
|
Section { |
|
|
|
Link(destination: URLs.appDescription.url) { |
|
|
|
Link(destination: URLs.appDescription.url) { |
|
|
|
Text("Page de présentation de Padel Club") |
|
|
|
Text("Page de présentation de Padel Club") |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Section { |
|
|
|
Section { |
|
|
|
Link(destination: URLs.privacy.url) { |
|
|
|
Link(destination: URLs.privacy.url) { |
|
|
|
Text("Politique de confidentialité") |
|
|
|
Text("Politique de confidentialité") |
|
|
|
@ -136,6 +138,16 @@ struct ToolboxView: View { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.onAppear { |
|
|
|
|
|
|
|
//#if DEBUG |
|
|
|
|
|
|
|
// self.showDebugViews = true |
|
|
|
|
|
|
|
//#endif |
|
|
|
|
|
|
|
// |
|
|
|
|
|
|
|
//#if TESTFLIGHT |
|
|
|
|
|
|
|
// self.showDebugViews = true |
|
|
|
|
|
|
|
//#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
.overlay(alignment: .bottom) { |
|
|
|
.overlay(alignment: .bottom) { |
|
|
|
if didResetApiCalls { |
|
|
|
if didResetApiCalls { |
|
|
|
Label("logs effacés", systemImage: "checkmark") |
|
|
|
Label("logs effacés", systemImage: "checkmark") |
|
|
|
@ -148,8 +160,16 @@ struct ToolboxView: View { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
.navigationTitle(TabDestination.toolbox.title) |
|
|
|
.navigationBarTitleDisplayMode(.large) |
|
|
|
|
|
|
|
// .navigationTitle(TabDestination.toolbox.title) |
|
|
|
.toolbar { |
|
|
|
.toolbar { |
|
|
|
|
|
|
|
ToolbarItem(placement: .principal) { |
|
|
|
|
|
|
|
Text(TabDestination.toolbox.title) |
|
|
|
|
|
|
|
.font(.headline) |
|
|
|
|
|
|
|
.onTapGesture { |
|
|
|
|
|
|
|
_handleTitleTap() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
ToolbarItem(placement: .topBarLeading) { |
|
|
|
ToolbarItem(placement: .topBarLeading) { |
|
|
|
Link(destination: URLs.appStore.url) { |
|
|
|
Link(destination: URLs.appStore.url) { |
|
|
|
Text("v\(PadelClubApp.appVersion)") |
|
|
|
Text("v\(PadelClubApp.appVersion)") |
|
|
|
@ -171,6 +191,30 @@ struct ToolboxView: View { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private func _handleTitleTap() { |
|
|
|
|
|
|
|
// Reset counter if too much time elapsed since last tap |
|
|
|
|
|
|
|
if let lastTime = lastTapTime, Date().timeIntervalSince(lastTime) > tapTimeThreshold { |
|
|
|
|
|
|
|
tapCount = 0 |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Update tap count and time |
|
|
|
|
|
|
|
tapCount += 1 |
|
|
|
|
|
|
|
lastTapTime = Date() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print("Tap count: \(tapCount)") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Check if we've reached 4 taps |
|
|
|
|
|
|
|
if tapCount == 4 { |
|
|
|
|
|
|
|
_secretFeatureActivated() |
|
|
|
|
|
|
|
tapCount = 0 |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private func _secretFeatureActivated() { |
|
|
|
|
|
|
|
self.showDebugViews = true |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//#Preview { |
|
|
|
//#Preview { |
|
|
|
|