Not has address

This commit is contained in:
Daniel Arantes Loverde
2026-02-07 17:16:45 -03:00
parent 92c2a67736
commit 54686397b9
28 changed files with 2115 additions and 498 deletions

View File

@@ -5,20 +5,29 @@ struct ContentView: View {
@State var selectedTab: MainTab = .home
private let tokenStore: TokenStore = DefaultTokenStore()
@State var appState = AppState()
#if os(Android)
@State var snackbarCenter = SnackbarCenter.shared
#else
@StateObject var snackbarCenter = SnackbarCenter.shared
#endif
var body: some View {
Group {
switch root {
case .auth:
AuthFlowView(root: $root, selectedTab: $selectedTab, tokenStore: tokenStore, appState: $appState)
case .main:
MainTabView(selectedTab: $selectedTab, root: $root, tokenStore: tokenStore, appState: $appState)
ZStack(alignment: .top) {
Group {
switch root {
case .auth:
AuthFlowView(root: $root, selectedTab: $selectedTab, tokenStore: tokenStore, appState: $appState)
case .main:
MainTabView(selectedTab: $selectedTab, root: $root, tokenStore: tokenStore, appState: $appState)
}
}
SnackbarOverlay(center: snackbarCenter)
}
.sheet(item: $appState.activeModal) { modal in
switch modal {
case .addressPicker:
AddressPickerModalView()
AddressPickerModalView(appState: $appState, selectedTab: $selectedTab)
case .filters:
FiltersModalView()
}
@@ -27,15 +36,40 @@ struct ContentView: View {
}
struct AddressPickerModalView: View {
@Binding var appState: AppState
@Binding var selectedTab: MainTab
@Environment(\.dismiss) var dismiss
var body: some View {
NavigationStack {
VStack(spacing: 12) {
if let message = appState.address.onboardingMessage {
Text(message)
.font(AppTypography.body)
.multilineTextAlignment(.center)
.foregroundStyle(AppColors.textPrimary)
.padding(.horizontal, 16)
.padding(.vertical, 12)
.frame(maxWidth: .infinity)
.background(AppColors.brandSoft)
.clipShape(RoundedRectangle(cornerRadius: 14, style: .continuous))
.padding(.horizontal, 20)
}
Text("Selecionar endereco")
.font(AppTypography.heading2)
Text("Fluxo de endereco sera implementado na etapa de checkout/perfil.")
.font(AppTypography.body)
.multilineTextAlignment(.center)
.foregroundStyle(AppColors.textMuted)
Button("Ir para Perfil > Endereços") {
selectedTab = .profile
dismiss()
}
.font(AppTypography.heading3)
.foregroundStyle(AppColors.primary)
.padding(.top, 8)
}
.padding(24)
.frame(maxWidth: .infinity, maxHeight: .infinity)