diff --git a/pedi-foods/Sources/PediFoods/Views/Main/StoreDetailView.swift b/pedi-foods/Sources/PediFoods/Views/Main/StoreDetailView.swift index 4d5bba6..5e6761a 100644 --- a/pedi-foods/Sources/PediFoods/Views/Main/StoreDetailView.swift +++ b/pedi-foods/Sources/PediFoods/Views/Main/StoreDetailView.swift @@ -46,25 +46,39 @@ struct StoreDetailView: View { let coverVisibleUntilY: CGFloat = 253 let storeLogoSize: CGFloat = 84 + var safeAreaTop: CGFloat { + #if canImport(UIKit) + return UIDevice.appSafeAreaTop + #else + return 0 + #endif + } + var body: some View { ScrollViewReader { proxy in - ScrollView(showsIndicators: false) { - ScrollOffsetReader(offsetY: $scrollOffset) - LazyVStack(spacing: 0, pinnedViews: [.sectionHeaders]) { - topSection - Section { + ZStack(alignment: .top) { + ScrollView(showsIndicators: false) { + ScrollOffsetReader(offsetY: $scrollOffset) + LazyVStack(spacing: 0) { + topSection + categoryTabs(proxy: proxy, isPinned: false) + .opacity(isCategoryTabsPinned ? 0 : 1) sectionedProducts - } header: { - categoryTabs(proxy: proxy, isPinned: isCategoryTabsPinned) } } - } - .coordinateSpace(name: StoreDetailScrollCoordinateSpace.name) - .refreshable { - await loadStoreData(forceRefresh: true) + .coordinateSpace(name: StoreDetailScrollCoordinateSpace.name) + .refreshable { + await loadStoreData(forceRefresh: true) + } + .ignoresSafeArea(edges: .top) + .background(AppColors.backgroundLight) + + categoryTabs(proxy: proxy, isPinned: true) + .opacity(isCategoryTabsPinned ? 1 : 0) + .allowsHitTesting(isCategoryTabsPinned) + .zIndex(10) } .ignoresSafeArea(edges: .top) - .background(AppColors.backgroundLight) .saturation(isStoreOpen ? 1 : 0) } .navigationBarBackButtonHidden(true)