Skip to content

Commit

Permalink
move geometry reader inside the component (#2082)
Browse files Browse the repository at this point in the history
  • Loading branch information
hchen-skyscanner authored Oct 17, 2024
1 parent 2968d95 commit bb036cb
Showing 1 changed file with 16 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ struct ImageGallerySlideshow<ImageView: View>: ViewModifier {
@Binding var currentIndex: Int

var body: some View {
GeometryReader { proxy in
VStack(spacing: .xl) {
ImageGalleryHeader(
closeAccessibilityLabel: closeAccessibilityLabel,
onCloseTapped: onCloseTapped
)
.padding([.leading, .top], .base)
ZStack(alignment: .bottom) {
VStack(spacing: .xl) {
ImageGalleryHeader(
closeAccessibilityLabel: closeAccessibilityLabel,
onCloseTapped: onCloseTapped
)
.padding([.leading, .top], .base)

ZStack(alignment: .bottom) {
GeometryReader { proxy in
InternalCarouselWrapper(
images: images.map {
$0.content()
Expand All @@ -62,16 +62,15 @@ struct ImageGallerySlideshow<ImageView: View>: ViewModifier {
currentIndex: $currentIndex
)
.frame(maxWidth: 400, maxHeight: 400)
BPKBadge("\(currentIndex + 1)/\(images.count)")
.badgeStyle(.strong)
.padding(.bottom, 20)
}

.accessibilityElement(children: .ignore)
.accessibilityHidden(true)

footer
BPKBadge("\(currentIndex + 1)/\(images.count)")
.badgeStyle(.strong)
.padding(.bottom, 20)
}
.accessibilityElement(children: .ignore)
.accessibilityHidden(true)

footer
}
.background(Color(.canvasContrastColor))
}
Expand Down

0 comments on commit bb036cb

Please sign in to comment.