Skip to content

Commit

Permalink
IOS-8419: Fix layout issues when exchanges list is used w/o bottom sh…
Browse files Browse the repository at this point in the history
…eet (#4152)

Signed-off-by: Andrey Fedorov <afedorov@tangem.com>
  • Loading branch information
m3g0byt3 authored Nov 2, 2024
1 parent 4973ac1 commit 1e37ae3
Showing 1 changed file with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ struct MarketsTokenDetailsExchangesListView: View {

@State private var isListContentObscured = false
@State private var headerHeight: CGFloat = .zero
@State private var safeArea: EdgeInsets = .init()

private var isDarkColorScheme: Bool { colorScheme == .dark }
private var defaultBackgroundColor: Color { Colors.Background.primary }
Expand All @@ -37,6 +38,7 @@ struct MarketsTokenDetailsExchangesListView: View {
.background(defaultBackgroundColor.ignoresSafeArea())
.animation(.default, value: viewModel.exchangesList)
.ignoresSafeArea(.container, edges: .top) // Without it, the content won't go into the safe area top zone on over-scroll
.readGeometry(\.safeAreaInsets, bindTo: $safeArea)
}

@ViewBuilder
Expand All @@ -46,11 +48,17 @@ struct MarketsTokenDetailsExchangesListView: View {
.opacity(viewModel.overlayContentHidingProgress)

VStack(spacing: 0) {
MarketsNavigationBar(
isMarketsSheetStyle: viewModel.isMarketsSheetStyle,
title: navigationBarTitle,
onBackButtonAction: viewModel.onBackButtonAction
)
if viewModel.isMarketsSheetStyle {
MarketsNavigationBar(
isMarketsSheetStyle: viewModel.isMarketsSheetStyle,
title: navigationBarTitle,
onBackButtonAction: viewModel.onBackButtonAction
)
} else {
// Native navigation bar is used, so we install an invisible spacer to align the header below the navigation bar
Color.clear
.frame(height: safeArea.top)
}

header
.opacity(viewModel.overlayContentHidingProgress)
Expand Down

0 comments on commit 1e37ae3

Please sign in to comment.