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>
This commit is contained in:
co-authored by
Cursor
parent
b926531447
commit
45bdda7c95
@@ -17,6 +17,7 @@ struct MatchPrimaryButton: View {
|
||||
.font(MatchTypography.labelLarge)
|
||||
.lineLimit(1)
|
||||
.minimumScaleFactor(0.7)
|
||||
.padding(.horizontal, 14)
|
||||
}
|
||||
}
|
||||
.frame(maxWidth: .infinity)
|
||||
|
||||
@@ -21,5 +21,8 @@ struct MatchScreenScaffold<Content: View, TopBar: View>: View {
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .top)
|
||||
.background(MatchColors.background)
|
||||
.foregroundStyle(.white)
|
||||
// Chrome custom: nasconde la navigation bar di sistema (evita chevron indietro spurî).
|
||||
.toolbar(.hidden, for: .navigationBar)
|
||||
.navigationBarBackButtonHidden(true)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ struct MatchSecondaryButton: View {
|
||||
.font(MatchTypography.labelLarge)
|
||||
.lineLimit(1)
|
||||
.minimumScaleFactor(0.7)
|
||||
.padding(.horizontal, 14)
|
||||
.frame(maxWidth: .infinity)
|
||||
.frame(height: 52)
|
||||
}
|
||||
|
||||
@@ -77,10 +77,7 @@ struct MatchesScreen: View {
|
||||
Text(L10n.t("matches.subtitle"))
|
||||
.font(MatchTypography.bodyMedium)
|
||||
.foregroundStyle(MatchColors.textSecondary)
|
||||
HStack(spacing: 12) {
|
||||
MatchSecondaryButton(label: L10n.t("matches.schedule").uppercased(), action: { showSchedule = true })
|
||||
MatchPrimaryButton(label: L10n.t("matches.new").uppercased(), action: { showNewMatch = true })
|
||||
}
|
||||
MatchPrimaryButton(label: L10n.t("matches.new").uppercased(), action: { showNewMatch = true })
|
||||
if let activeTeam {
|
||||
TeamPickerBar(
|
||||
team: activeTeam,
|
||||
|
||||
@@ -1,7 +1,15 @@
|
||||
import SwiftUI
|
||||
|
||||
struct AppNavHost: View {
|
||||
private enum RootScreen {
|
||||
case splash
|
||||
case login
|
||||
case matches
|
||||
}
|
||||
|
||||
@StateObject private var container = AppContainer()
|
||||
@State private var root: RootScreen = .splash
|
||||
/// Solo destinazioni sopra la root (account, recupero password).
|
||||
@State private var path: [Routes] = []
|
||||
@State private var wizardRoute: WizardRoute?
|
||||
@State private var broadcastRoute: BroadcastRoute?
|
||||
@@ -17,49 +25,27 @@ struct AppNavHost: View {
|
||||
|
||||
var body: some View {
|
||||
NavigationStack(path: $path) {
|
||||
SplashScreen(
|
||||
container: container,
|
||||
onAuthenticated: { path = [.matches] },
|
||||
onUnauthenticated: { path = [.login] }
|
||||
)
|
||||
.navigationDestination(for: Routes.self) { route in
|
||||
switch route {
|
||||
case .splash:
|
||||
EmptyView()
|
||||
case .login:
|
||||
LoginScreen(
|
||||
container: container,
|
||||
onLoggedIn: { path = [.matches] },
|
||||
onForgotPassword: { path.append(.forgotPassword) }
|
||||
)
|
||||
case .forgotPassword:
|
||||
ForgotPasswordScreen(
|
||||
container: container,
|
||||
onBack: { path.removeLast() }
|
||||
)
|
||||
case .matches:
|
||||
MatchesScreen(
|
||||
container: container,
|
||||
refreshToken: matchesRefreshToken,
|
||||
onOpenSetup: { matchId in
|
||||
wizardRoute = WizardRoute(matchId: matchId, step: 1)
|
||||
},
|
||||
onOpenBroadcast: { sessionId in
|
||||
broadcastRoute = BroadcastRoute(sessionId: sessionId)
|
||||
},
|
||||
onOpenAccount: { path.append(.account) }
|
||||
)
|
||||
.lockPortraitOrientation()
|
||||
case .account:
|
||||
AccountScreen(
|
||||
container: container,
|
||||
onBack: { path.removeLast() },
|
||||
onLoggedOut: { path = [.login] }
|
||||
)
|
||||
case .setup, .broadcast:
|
||||
EmptyView()
|
||||
rootContent
|
||||
.navigationDestination(for: Routes.self) { route in
|
||||
switch route {
|
||||
case .forgotPassword:
|
||||
ForgotPasswordScreen(
|
||||
container: container,
|
||||
onBack: { path.removeLast() }
|
||||
)
|
||||
case .account:
|
||||
AccountScreen(
|
||||
container: container,
|
||||
onBack: { path.removeLast() },
|
||||
onLoggedOut: {
|
||||
path = []
|
||||
root = .login
|
||||
}
|
||||
)
|
||||
case .splash, .login, .matches, .setup, .broadcast:
|
||||
EmptyView()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.environment(\.locale, appLocale)
|
||||
.onReceive(NotificationCenter.default.publisher(for: .appLanguageDidChange)) { _ in
|
||||
@@ -98,7 +84,8 @@ struct AppNavHost: View {
|
||||
AppOrientation.lockPortrait()
|
||||
container.wizardSession.reset()
|
||||
broadcastRoute = nil
|
||||
path = [.matches]
|
||||
path = []
|
||||
root = .matches
|
||||
}
|
||||
.keepScreenOn()
|
||||
}
|
||||
@@ -109,4 +96,44 @@ struct AppNavHost: View {
|
||||
}
|
||||
.environmentObject(container)
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
private var rootContent: some View {
|
||||
switch root {
|
||||
case .splash:
|
||||
SplashScreen(
|
||||
container: container,
|
||||
onAuthenticated: {
|
||||
path = []
|
||||
root = .matches
|
||||
},
|
||||
onUnauthenticated: {
|
||||
path = []
|
||||
root = .login
|
||||
}
|
||||
)
|
||||
case .login:
|
||||
LoginScreen(
|
||||
container: container,
|
||||
onLoggedIn: {
|
||||
path = []
|
||||
root = .matches
|
||||
},
|
||||
onForgotPassword: { path.append(.forgotPassword) }
|
||||
)
|
||||
case .matches:
|
||||
MatchesScreen(
|
||||
container: container,
|
||||
refreshToken: matchesRefreshToken,
|
||||
onOpenSetup: { matchId in
|
||||
wizardRoute = WizardRoute(matchId: matchId, step: 1)
|
||||
},
|
||||
onOpenBroadcast: { sessionId in
|
||||
broadcastRoute = BroadcastRoute(sessionId: sessionId)
|
||||
},
|
||||
onOpenAccount: { path.append(.account) }
|
||||
)
|
||||
.lockPortraitOrientation()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user