This commit is contained in:
Daniel Arantes Loverde
2026-04-16 14:50:07 -03:00
parent 7f7d414e6c
commit 0ebb854213
20 changed files with 871 additions and 216 deletions

View File

@@ -34,6 +34,7 @@ struct StoreDetailView: View {
@State var categoryHeaderOffsets: [String: CGFloat] = [:]
@State var isProgrammaticCategoryScroll = false
@State var scrollOffsetY: CGFloat = 0
@State var isFavoriteRequestInFlight = false
let cardTopInset: CGFloat = 168
let summaryCardBaseHeight: CGFloat = 170
@@ -52,6 +53,7 @@ struct StoreDetailView: View {
ScrollView(showsIndicators: false) {
#if os(Android)
LazyVStack(spacing: 0) {
ScrollOffsetReader(offsetY: $scrollOffsetY)
topSection
categoryTabs(proxy: proxy, safeTop: safeTop, isSticky: false)
@@ -60,6 +62,7 @@ struct StoreDetailView: View {
}
#else
LazyVStack(spacing: 0, pinnedViews: [.sectionHeaders]) {
ScrollOffsetReader(offsetY: $scrollOffsetY)
topSection
categoryTabs(proxy: proxy, safeTop: safeTop, isSticky: false)
@@ -71,8 +74,8 @@ struct StoreDetailView: View {
.refreshable {
await loadStoreData(forceRefresh: true)
}
.coordinateSpace(name: StoreDetailScrollCoordinateSpace.name)
.ignoresSafeArea(edges: .top)
.background(ScrollOffsetReader(offsetY: $scrollOffsetY))
}
.ignoresSafeArea(edges: .top)
.overlay(alignment: .top) {
@@ -218,7 +221,14 @@ struct StoreDetailView: View {
}
Spacer()
heroIconButton(icon: "magnifyingglass") {}
heroIconButton(icon: "heart") {}
heroIconButton(
icon: isFavoriteStore ? "heart.fill" : "heart",
foregroundStyle: isFavoriteStore ? Color.red : Color.white
) {
Task {
await toggleFavoriteStore()
}
}
}
.padding(.horizontal, 14)
.padding(.top, UIDevice.topNotch)