fix(store): pin all non-image elements during overscroll bounce
Apply offset(y: -stretchAmount) to gradient, buttons, summaryCard, storeLogoBadge, and hard-cut rectangle so only the cover image stretches on pull-down
This commit is contained in:
@@ -11,14 +11,16 @@ extension StoreDetailView {
|
|||||||
Rectangle()
|
Rectangle()
|
||||||
.fill(AppColors.backgroundLight)
|
.fill(AppColors.backgroundLight)
|
||||||
.frame(height: max(0, topSectionHeight - coverVisibleUntilY))
|
.frame(height: max(0, topSectionHeight - coverVisibleUntilY))
|
||||||
.offset(y: coverVisibleUntilY)
|
.offset(y: coverVisibleUntilY - stretchAmount)
|
||||||
|
|
||||||
summaryCard
|
summaryCard
|
||||||
.padding(.horizontal, 16)
|
.padding(.horizontal, 16)
|
||||||
.padding(.top, cardTopInset)
|
.padding(.top, cardTopInset)
|
||||||
|
.offset(y: -stretchAmount)
|
||||||
|
|
||||||
storeLogoBadge
|
storeLogoBadge
|
||||||
.padding(.top, cardTopInset - (storeLogoSize / 2))
|
.padding(.top, cardTopInset - (storeLogoSize / 2))
|
||||||
|
.offset(y: -stretchAmount)
|
||||||
}
|
}
|
||||||
.frame(height: topSectionHeight)
|
.frame(height: topSectionHeight)
|
||||||
}
|
}
|
||||||
@@ -37,6 +39,7 @@ extension StoreDetailView {
|
|||||||
)
|
)
|
||||||
.frame(height: topSectionHeight)
|
.frame(height: topSectionHeight)
|
||||||
.ignoresSafeArea(.container, edges: .top)
|
.ignoresSafeArea(.container, edges: .top)
|
||||||
|
.offset(y: -stretchAmount)
|
||||||
.allowsHitTesting(false)
|
.allowsHitTesting(false)
|
||||||
|
|
||||||
VStack(spacing: 0) {
|
VStack(spacing: 0) {
|
||||||
@@ -66,6 +69,7 @@ extension StoreDetailView {
|
|||||||
.foregroundStyle(Color.white.opacity(0.92))
|
.foregroundStyle(Color.white.opacity(0.92))
|
||||||
.padding(.bottom, 14)
|
.padding(.bottom, 14)
|
||||||
}
|
}
|
||||||
|
.offset(y: -stretchAmount)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user