Skip to content

Commit 586c5a6

Browse files
ALFMOB-61: Fix iPad and legacyView
1 parent 92ee7d8 commit 586c5a6

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

Alfie/Alfie/Views/ProductDetails/ProductDetailsView.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,9 @@ struct ProductDetailsView<ViewModel: ProductDetailsViewModelProtocol>: View {
141141
let screenHeight = geometry.size.height
142142
let collapsedHeight = screenHeight - carouselSize.height
143143
let shouldHavePinnedButtons = collapsedHeight > 100
144-
// TODO: Check if margins should be included in calculations
145144
let expandedHeight = shouldHavePinnedButtons ?
146-
min(complementaryViewSize.height + 0 + Spacing.space100, screenHeight) :
147-
min(complementaryViewSize.height + 0 + bottomButtonsSize.height + Spacing.space100 + 0 + 0, screenHeight)
145+
min(complementaryViewSize.height + Spacing.space100, screenHeight) :
146+
min(complementaryViewSize.height + bottomButtonsSize.height + Spacing.space100, screenHeight)
148147

149148
ZStack(alignment: .top) {
150149
VStack {
@@ -157,7 +156,7 @@ struct ProductDetailsView<ViewModel: ProductDetailsViewModelProtocol>: View {
157156
showCapsule: true,
158157
expandedHeight: expandedHeight,
159158
collapsedHeight: collapsedHeight,
160-
dragStartOffset: carouselSize.height, // TODO: Check if we can delete this
159+
dragStartOffset: carouselSize.height,
161160
expansionSignal: $shouldCollapseDraggableBottomSheet.negate
162161
) {
163162
complementaryViews
@@ -207,6 +206,9 @@ struct ProductDetailsView<ViewModel: ProductDetailsViewModelProtocol>: View {
207206
.fullScreenCover(isPresented: $isMediaFullScreen) {
208207
fullscreenMediaCarousel
209208
}
209+
.sheet(isPresented: $showSizeSheet) {
210+
sizeSheet
211+
}
210212
.sheet(isPresented: $showColorSheet, onDismiss: { colorSheetSearchText = "" }, content: {
211213
colorSheet
212214
})

Alfie/AlfieKit/Sources/StyleGuide/Components/SnapCarousel/SnapCarousel.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ public struct SnapCarousel<Content: View>: View {
5050

5151
public var body: some View {
5252
GeometryReader { proxy in
53-
let sideCutWidth = isSingleItem ? 0 : proxy.size.width / Spacing.space250
53+
let sideCutWidth = isIpad ?
54+
proxy.size.width / Spacing.space075 :
55+
(isSingleItem ? 0 : proxy.size.width / Spacing.space250)
5456
let itemWidth = proxy.size.width - (2 * itemSpacing + 2 * sideCutWidth)
5557
let itemHeight = itemWidth / itemAspectRatio
5658
// Adjustment that keeps the images centered on each swipe

0 commit comments

Comments
 (0)