Skip to content

Commit

Permalink
fix: Use newMessageCellAlignment
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinperignon committed Jun 20, 2023
1 parent 6882056 commit 934c563
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ import MailResources
import RealmSwift
import SwiftUI

extension VerticalAlignment {
private struct NewMessageCellAlignment: AlignmentID {
static func defaultValue(in context: ViewDimensions) -> CGFloat {
context[.firstTextBaseline]
}
}

static let newMessageCellAlignment = VerticalAlignment(NewMessageCellAlignment.self)
}

struct ComposeMessageCellRecipients: View {
@State private var currentText = ""
@State private var autocompletion = [Recipient]()
Expand All @@ -38,7 +48,7 @@ struct ComposeMessageCellRecipients: View {
var body: some View {
VStack(spacing: 0) {
if autocompletionType == nil || autocompletionType == type {
HStack {
HStack(alignment: .newMessageCellAlignment) {
Text(type.title)
.textStyle(.bodySecondary)

Expand Down
10 changes: 0 additions & 10 deletions Mail/Views/New Message/RecipientField.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,6 @@ import RealmSwift
import SwiftUI
import WrappingHStack

extension VerticalAlignment {
private struct NewMessageCellAlignment: AlignmentID {
static func defaultValue(in context: ViewDimensions) -> CGFloat {
context[.firstTextBaseline]
}
}

static let newMessageCellAlignment = VerticalAlignment(NewMessageCellAlignment.self)
}

struct RecipientField: View {
@State private var keyboardHeight: CGFloat = 0

Expand Down

0 comments on commit 934c563

Please sign in to comment.