Skip to content

Commit

Permalink
fix: Recipient names fill the available space
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinperignon committed Jan 31, 2024
1 parent 2e3a06c commit 4f6176a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Mail/Components/ThreadCell/ThreadCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ struct ThreadCell: View {
.accessibilityLabel(additionalAccessibilityLabel)
.accessibilityHidden(additionalAccessibilityLabel.isEmpty)

ThreadCellCheckboxView(
ThreadCellAvatarCheckboxView(
accentColor: accentColor,
density: density,
isSelected: isSelected,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import MailCore
import SwiftUI

struct ThreadCellCheckboxView: View {
struct ThreadCellAvatarCheckboxView: View {
@EnvironmentObject private var mailboxManager: MailboxManager

let accentColor: AccentColor
Expand Down Expand Up @@ -54,7 +54,7 @@ struct ThreadCellCheckboxView: View {
}

#Preview {
ThreadCellCheckboxView(
ThreadCellAvatarCheckboxView(
accentColor: .pink,
density: .large,
isSelected: false,
Expand Down
29 changes: 16 additions & 13 deletions Mail/Components/ThreadCell/ThreadCellHeaderView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,29 @@ struct ThreadCellHeaderView: View, Equatable {

var body: some View {
HStack(spacing: UIPadding.small) {
if showDraftPrefix {
Text("\(MailResourcesStrings.Localizable.draftPrefix)")
.textStyle(.bodyMediumError)
HStack(spacing: UIPadding.small) {
if showDraftPrefix {
Text("\(MailResourcesStrings.Localizable.draftPrefix)")
.textStyle(.bodyMediumError)
.lineLimit(1)
.layoutPriority(1)
}

Text(recipientsTitle)
.textStyle(.bodyMedium)
.lineLimit(1)
.layoutPriority(1)
}

Text(recipientsTitle)
.textStyle(.bodyMedium)
.lineLimit(1)

if messageCount > 1 {
ThreadCountIndicatorView(messagesCount: messageCount, hasUnseenMessages: prominentMessageCount)
.accessibilityHidden(true)
if messageCount > 1 {
ThreadCountIndicatorView(messagesCount: messageCount, hasUnseenMessages: prominentMessageCount)
.accessibilityHidden(true)
}
}
.frame(maxWidth: .infinity, alignment: .leading)

Text(formattedDate)
.textStyle(.bodySmallSecondary)
.lineLimit(1)
.frame(maxWidth: .infinity, alignment: .trailing)
.layoutPriority(1)
.accessibilityHidden(true)
}
}
Expand Down

0 comments on commit 4f6176a

Please sign in to comment.