Login flow fixed

This commit is contained in:
Daniel Arantes Loverde
2026-02-05 16:57:27 -03:00
parent 01c1da0430
commit 51d02f6715
12 changed files with 859 additions and 108 deletions

View File

@@ -4,9 +4,12 @@ import UIKit
#endif
struct HomeView: View {
@Binding var appState: AppState
@State var searchText = ""
@State var selectedCategory = "Stores"
@State var scrollOffset: CGFloat = 0
@State var hasRequestedLocation = false
let locationService = LocationService()
private let categories: [CategoryModel] = [
.init(title: "Stores", systemIcon: "storefront"),
@@ -104,6 +107,15 @@ struct HomeView: View {
.background(AppColors.backgroundLight)
.ignoresSafeArea(edges: .top)
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .top)
.onAppear {
if hasRequestedLocation == false {
hasRequestedLocation = true
locationService.requestLocation { lat, lng in
appState.address.latitude = lat
appState.address.longitude = lng
}
}
}
}
private var contentStack: some View {
@@ -175,7 +187,7 @@ struct HomeView: View {
.foregroundStyle(AppColors.brandSoft)
HStack(spacing: 6) {
Text("Canggu, Kuta Utara, Bali")
Text(appState.address.display)
.font(AppTypography.heading3)
.foregroundStyle(AppColors.textInverse)
Image(systemName: "chevron.down")