From 43dea5d0ba259c108723d3d9c6cd17dd96eb9b02 Mon Sep 17 00:00:00 2001 From: mike-dydx <149746839+mike-dydx@users.noreply.github.com> Date: Fri, 10 Nov 2023 17:38:32 -0500 Subject: [PATCH] make portfolio selector sticky (#20) --- .../dydxPortfolioSectionsView.swift | 1 + .../_v4/Portfolio/dydxPortfolioView.swift | 38 +++++++++---------- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/dydx/dydxViews/dydxViews/_v4/Portfolio/Components/dydxPortfolioSectionsView.swift b/dydx/dydxViews/dydxViews/_v4/Portfolio/Components/dydxPortfolioSectionsView.swift index 36910e546..2f2720f9a 100644 --- a/dydx/dydxViews/dydxViews/_v4/Portfolio/Components/dydxPortfolioSectionsView.swift +++ b/dydx/dydxViews/dydxViews/_v4/Portfolio/Components/dydxPortfolioSectionsView.swift @@ -51,6 +51,7 @@ public class dydxPortfolioSectionsViewModel: PlatformViewModel { } } .padding(.vertical, 16) + .themeColor(background: .layer2) ) } } diff --git a/dydx/dydxViews/dydxViews/_v4/Portfolio/dydxPortfolioView.swift b/dydx/dydxViews/dydxViews/_v4/Portfolio/dydxPortfolioView.swift index 245c00714..c3dea4f93 100644 --- a/dydx/dydxViews/dydxViews/_v4/Portfolio/dydxPortfolioView.swift +++ b/dydx/dydxViews/dydxViews/_v4/Portfolio/dydxPortfolioView.swift @@ -147,26 +147,26 @@ public class dydxPortfolioViewModel: PlatformViewModel { .animateHeight(height: self.expanded ? 460 : 332) .animation(.easeIn(duration: 0.2), value: self.expanded) - self.sections.createView(parentStyle: style) - - switch self.sectionSelection { - case .trades: - self.fills - .createView(parentStyle: style) - case .positions: - self.positions - .createView(parentStyle: style) - case .orders: - self.orders - .createView(parentStyle: style) - case .funding: - self.funding - .createView(parentStyle: style) - case .transfers, .fees: - PlatformView.nilView + Section(header: self.sections.createView(parentStyle: style)) { + switch self.sectionSelection { + case .trades: + self.fills + .createView(parentStyle: style) + case .positions: + self.positions + .createView(parentStyle: style) + case .orders: + self.orders + .createView(parentStyle: style) + case .funding: + self.funding + .createView(parentStyle: style) + case .transfers, .fees: + PlatformView.nilView + } + // add space to adjust for tab bar + Spacer(minLength: 80) } - // add space to adjust for tab bar - Spacer(minLength: 80) } } )