Skip to content

Commit

Permalink
Bugfix FXIOS-10443 ⁃ [Menu] Fix vertical padding for the accounts sec…
Browse files Browse the repository at this point in the history
…tion at the top (#22991)

FXIOS-10443 #22857 ⁃ [Menu Redesign] Fix vertical padding for the accounts section at the top
  • Loading branch information
dicarobinho authored Nov 11, 2024
1 parent 2129764 commit e133240
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
5 changes: 3 additions & 2 deletions BrowserKit/Sources/ComponentLibrary/Headers/HeaderView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import SiteImageView
public final class HeaderView: UIView, ThemeApplicable {
private struct UX {
static let headerLinesLimit: Int = 2
static let siteDomainLabelsVerticalSpacing: CGFloat = 12
static let siteDomainLabelsVerticalSpacing: CGFloat = 13
static let siteDomainLabelsHorizontalSpacing: CGFloat = 12
static let largeFaviconImageSize: CGFloat = 48
static let favIconImageSize: CGFloat = 32
static let smallFaviconImageSize: CGFloat = 24
Expand Down Expand Up @@ -108,7 +109,7 @@ public final class HeaderView: UIView, ThemeApplicable {
),
headerLabelsContainer.leadingAnchor.constraint(
equalTo: isWebsiteIcon ? favicon.trailingAnchor : iconMask.trailingAnchor,
constant: UX.siteDomainLabelsVerticalSpacing
constant: UX.siteDomainLabelsHorizontalSpacing
),
headerLabelsContainer.trailingAnchor.constraint(
equalTo: warningIconView.leadingAnchor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public final class NavigationHeaderView: UIView {
private struct UX {
static let closeButtonSize: CGFloat = 30
static let imageMargins: CGFloat = 10
static let baseDistance: CGFloat = 20
static let baseDistance: CGFloat = 21
static let horizontalMargin: CGFloat = 16
static let separatorHeight: CGFloat = 1
static let largeFaviconImageSize: CGFloat = 48
Expand Down
7 changes: 4 additions & 3 deletions BrowserKit/Sources/MenuKit/MenuDetailView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ public final class MenuDetailView: UIView,
MenuTableViewDataDelegate, ThemeApplicable {
private struct UX {
static let headerLineOffset: CGFloat = 35
static let headerTopMargin: CGFloat = 10
static let headerTopMargin: CGFloat = 15
static let horizontalTableViewMargin: CGFloat = 4
}

// MARK: - UI Elements
Expand Down Expand Up @@ -41,8 +42,8 @@ public final class MenuDetailView: UIView,

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

Expand Down
7 changes: 4 additions & 3 deletions BrowserKit/Sources/MenuKit/MenuMainView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import ComponentLibrary
public final class MenuMainView: UIView,
MenuTableViewDataDelegate, ThemeApplicable {
private struct UX {
static let headerTopMargin: CGFloat = 10
static let headerTopMargin: CGFloat = 15
static let horizontalTableViewMargin: CGFloat = 4
}

// MARK: - UI Elements
Expand Down Expand Up @@ -42,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),
tableView.trailingAnchor.constraint(equalTo: self.trailingAnchor)
tableView.leadingAnchor.constraint(equalTo: self.leadingAnchor, constant: -UX.horizontalTableViewMargin),
tableView.trailingAnchor.constraint(equalTo: self.trailingAnchor, constant: UX.horizontalTableViewMargin)
])
}

Expand Down
2 changes: 1 addition & 1 deletion BrowserKit/Sources/MenuKit/MenuTableView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class MenuTableView: UIView,
UITableViewDataSource,
ThemeApplicable {
private struct UX {
static let topPadding: CGFloat = 10
static let topPadding: CGFloat = 12
}

private var tableView: UITableView
Expand Down

0 comments on commit e133240

Please sign in to comment.