[auth-payment-login-lockout] Unify auth back button and animate the flow entry

- RegistrationView / LoginEmailView / OtpView: pushed with no nav bar, so
  they showed the oversized iOS 26 system glass back button. Wrapped each
  in LCENavigationView with the standard AppBackButtonIcon, matching
  LoginView and every other screen. Dropped the now-dead colorScheme dark
  branches and forced .preferredColorScheme(.light) (app has no dark
  theme).
- ContentView: root .auth <-> .main switched with no transition. Added
  .move transitions on both branches and wrapped enterAuthFlow() /
  LoginView's back action in withAnimation, so opening auth from Profile's
  'Entrar ou Cadastrar' now slides in and back slides out.
- ProfileLoggedOutFlowTests: new test asserting the pushed auth screens
  carry the LCENavigationView back button.
This commit is contained in:
Daniel Arantes Loverde
2026-08-27 10:59:06 -03:00
parent 21250ec2b9
commit 0f0672f18d
6 changed files with 81 additions and 15 deletions

View File

@@ -1,5 +1,8 @@
import SwiftUI
import UIKit
#if canImport(LCEssentials)
import LCEssentials
#endif
struct OtpView: View {
private let resendDelaySeconds = 45
@@ -21,13 +24,23 @@ struct OtpView: View {
@Environment(\.dismiss) var dismiss
var body: some View {
LCENavigationView {
content
}
.setLeftButton(image: AnyView(AppBackButtonIcon())) { dismiss() }
.setNavigationBarBackgroundColor(AppColors.backgroundLight)
.buttonStyle(.plain)
.preferredColorScheme(.light)
}
private var content: some View {
ScrollView {
VStack(spacing: 0) {
SwiftUI.Image("pedifoods")
.resizable()
.scaledToFit()
.frame(width: 74, height: 74)
.padding(.top, 140)
.padding(.top, 48)
Text("Verificação")
.font(AppTypography.heading1)
@@ -122,7 +135,6 @@ struct OtpView: View {
}
.scrollDismissesKeyboard(.interactively)
.background(AppColors.backgroundLight)
.ignoresSafeArea()
.onAppear {
isOtpFocused = true
startResendCooldown()