Skip to content

Commit

Permalink
make portfolio selector sticky (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-dydx committed Aug 21, 2024
1 parent 4ee94a0 commit 43dea5d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public class dydxPortfolioSectionsViewModel: PlatformViewModel {
}
}
.padding(.vertical, 16)
.themeColor(background: .layer2)
)
}
}
Expand Down
38 changes: 19 additions & 19 deletions dydx/dydxViews/dydxViews/_v4/Portfolio/dydxPortfolioView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
)
Expand Down

0 comments on commit 43dea5d

Please sign in to comment.