Skip to content

Commit

Permalink
feat: Use UIConstants
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinperignon committed Jul 17, 2023
1 parent ea38021 commit 378837e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
6 changes: 3 additions & 3 deletions Mail/Views/Bottom sheets/Actions/ActionsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ struct ActionsView: View {
}

var body: some View {
VStack(alignment: .leading, spacing: 12) {
VStack(alignment: .leading, spacing: UIConstants.actionsViewSpacing) {
// Quick actions
HStack(alignment: .top, spacing: 16) {
ForEach(viewModel.quickActions) { action in
Expand All @@ -71,10 +71,10 @@ struct ActionsView: View {
}
}
}
.padding(.horizontal, 24)
.padding(.horizontal, UIConstants.actionsViewCellHorizontalPadding)
}
}
.padding(.horizontal, 8)
.padding(.horizontal, UIConstants.actionsViewHorizontalPadding)
.matomoView(view: [MatomoUtils.View.bottomSheet.displayName, "ActionsView"])
}
}
Expand Down
6 changes: 3 additions & 3 deletions Mail/Views/Bottom sheets/Actions/ContactActionsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ struct ContactActionsView: View {
}

var body: some View {
VStack(alignment: .leading, spacing: 12) {
VStack(alignment: .leading, spacing: UIConstants.actionsViewSpacing) {
ContactActionsHeaderView(displayablePerson: CommonContact(
recipient: recipient,
contextMailboxManager: mailboxManager
Expand All @@ -62,11 +62,11 @@ struct ContactActionsView: View {
}
handleAction(action)
}
.padding(.horizontal, 24)
.padding(.horizontal, UIConstants.actionsViewCellHorizontalPadding)
}
}
.frame(maxWidth: .infinity, alignment: .leading)
.padding(.horizontal, 8)
.padding(.horizontal, UIConstants.actionsViewHorizontalPadding)
.sheet(item: $writtenToRecipient) { writtenToRecipient in
ComposeMessageView.writingTo(recipient: writtenToRecipient, mailboxManager: mailboxManager)
}
Expand Down
6 changes: 3 additions & 3 deletions Mail/Views/Bottom sheets/Actions/ReportJunkView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ struct ReportJunkView: View {
}

var body: some View {
VStack(alignment: .leading, spacing: 12) {
VStack(alignment: .leading, spacing: UIConstants.actionsViewSpacing) {
ForEach(actions) { action in
if action != actions.first {
IKDivider()
Expand All @@ -56,10 +56,10 @@ struct ReportJunkView: View {
}
}
}
.padding(.horizontal, 24)
.padding(.horizontal, UIConstants.actionsViewCellHorizontalPadding)
}
}
.padding(.horizontal, 8)
.padding(.horizontal, UIConstants.actionsViewHorizontalPadding)
.matomoView(view: [MatomoUtils.View.bottomSheet.displayName, "ReportJunkView"])
}
}
Expand Down
4 changes: 4 additions & 0 deletions MailCore/UI/UIConstants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ public enum UIConstants {

public static let bottomSheetHorizontalPadding: CGFloat = 24

public static let actionsViewSpacing: CGFloat = 12
public static let actionsViewHorizontalPadding: CGFloat = 8
public static let actionsViewCellHorizontalPadding: CGFloat = 24

public static let unknownRecipientHorizontalPadding: CGFloat = 8

public static let autocompletionVerticalPadding: CGFloat = 8
Expand Down

0 comments on commit 378837e

Please sign in to comment.