Skip to content

Commit

Permalink
Made layout consistent between orders and fills
Browse files Browse the repository at this point in the history
  • Loading branch information
ruixhuang committed Nov 22, 2023
1 parent a9d3886 commit 36f5c58
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,12 @@ public class dydxPortfolioFundingViewModel: PlatformListViewModel {

private let _placeholder = PlaceholderViewModel()

public init() {
super.init()
public init(items: [PlatformViewModel] = [], contentChanged: (() -> Void)? = nil) {
super.init(items: items,
intraItemSeparator: true,
firstListItemTopSeparator: true,
lastListItemBottomSeparator: true,
contentChanged: contentChanged)
self.placeholder = _placeholder
self.header = createHeader().wrappedViewModel
self.width = UIScreen.main.bounds.width - 16
Expand All @@ -177,6 +181,7 @@ public class dydxPortfolioFundingViewModel: PlatformListViewModel {
Text(DataLocalizer.localize(path: "APP.GENERAL.PRICE_FEE"))
}
.padding(.horizontal, 16)
.padding(.bottom, 16)
.themeFont(fontSize: .small)
.themeColor(foreground: .textTertiary)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ public class dydxPortfolioOrderItemViewModel: PlatformViewModel {
.frame(width: 42, height: 42)
}
}

}

private func createMain(parentStyle: ThemeStyle) -> some View {
Expand Down Expand Up @@ -188,8 +189,12 @@ public class dydxPortfolioOrdersViewModel: PlatformListViewModel {

private let _placeholder = PlaceholderViewModel()

public init() {
super.init(intraItemSeparator: false)
public init(items: [PlatformViewModel] = [], contentChanged: (() -> Void)? = nil) {
super.init(items: items,
intraItemSeparator: true,
firstListItemTopSeparator: true,
lastListItemBottomSeparator: true,
contentChanged: contentChanged)
self.placeholder = _placeholder
self.header = createHeader().wrappedViewModel
self.width = UIScreen.main.bounds.width - 16
Expand All @@ -211,6 +216,7 @@ public class dydxPortfolioOrdersViewModel: PlatformListViewModel {
Text(DataLocalizer.localize(path: "APP.GENERAL.PRICE_TYPE"))
}
.padding(.horizontal, 16)
.padding(.bottom, 16)
.themeFont(fontSize: .small)
.themeColor(foreground: .textTertiary)
}
Expand Down

0 comments on commit 36f5c58

Please sign in to comment.