Skip to content

Commit

Permalink
Bugfix FXIOS-10569 ⁃ [Menu] Fix the margin and Padding for the sectio…
Browse files Browse the repository at this point in the history
…ns/islands in the menu. (#23308)

FXIOS-10569 #23140 ⁃ [Menu Redesign] Fix the margin and Padding for the sections/islands in the menu.
  • Loading branch information
dicarobinho authored and clarmso committed Nov 25, 2024
1 parent f83ae33 commit 2ea2250
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions BrowserKit/Sources/MenuKit/MenuMainView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ public final class MenuMainView: UIView,

tableView.topAnchor.constraint(equalTo: accountHeaderView.bottomAnchor),
tableView.bottomAnchor.constraint(equalTo: self.bottomAnchor),
tableView.leadingAnchor.constraint(equalTo: self.leadingAnchor, constant: -UX.horizontalTableViewMargin),
tableView.trailingAnchor.constraint(equalTo: self.trailingAnchor, constant: UX.horizontalTableViewMargin)
tableView.leadingAnchor.constraint(equalTo: self.leadingAnchor),
tableView.trailingAnchor.constraint(equalTo: self.trailingAnchor)
])
}

Expand Down
6 changes: 5 additions & 1 deletion BrowserKit/Sources/MenuKit/MenuTableView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ class MenuTableView: UIView,
ThemeApplicable {
private struct UX {
static let topPadding: CGFloat = 12
static let tableViewMargin: CGFloat = 16
static let distanceBetweenSections: CGFloat = 32
}

private var tableView: UITableView
Expand All @@ -26,6 +28,8 @@ class MenuTableView: UIView,

override init(frame: CGRect) {
tableView = UITableView(frame: .zero, style: .insetGrouped)
tableView.layoutMargins = UIEdgeInsets(top: 0, left: UX.tableViewMargin, bottom: 0, right: UX.tableViewMargin)
tableView.sectionFooterHeight = 0
menuData = []
super.init(frame: .zero)
setupView()
Expand Down Expand Up @@ -70,7 +74,7 @@ class MenuTableView: UIView,
_ tableView: UITableView,
heightForHeaderInSection section: Int
) -> CGFloat {
return section == 0 ? UX.topPadding : UITableView.automaticDimension
return section == 0 ? UX.topPadding : UX.distanceBetweenSections
}

func tableView(
Expand Down

0 comments on commit 2ea2250

Please sign in to comment.