Compare commits
No commits in common. "59a1c6e035a3126e4785d357f5bac00f3954a89c" and "b25fa165487ae6fe7cb1df37e6e7e89a771b4e5a" have entirely different histories.
59a1c6e035
...
b25fa16548
@ -267,41 +267,30 @@ struct PrivateChatView: View {
|
||||
isCurrentUser: Bool
|
||||
) -> some View {
|
||||
let timeText = timestamp(for: message)
|
||||
let bubbleColor = isCurrentUser ? Color.accentColor : Color(.secondarySystemBackground)
|
||||
let foregroundColor = isCurrentUser ? Color.white : Color.primary
|
||||
|
||||
// Use a single HStack with bottom alignment to keep text and time on the same line,
|
||||
// with the time aligning to the bottom.
|
||||
return HStack(alignment: .bottom, spacing: 8) {
|
||||
let bubbleColor = isCurrentUser ? Color.accentColor : Color(.secondarySystemBackground)
|
||||
|
||||
return VStack(alignment: isCurrentUser ? .trailing : .leading, spacing: 4) {
|
||||
Text(contentText(for: message))
|
||||
.font(.body)
|
||||
.foregroundColor(foregroundColor)
|
||||
.foregroundColor(isCurrentUser ? .white : .primary)
|
||||
.multilineTextAlignment(.leading)
|
||||
|
||||
// This view contains the time and the optional checkmark.
|
||||
// It's pushed to the right by the expanding Text view.
|
||||
HStack(spacing: 4) {
|
||||
if !timeText.isEmpty {
|
||||
Text(timeText)
|
||||
.font(.caption2)
|
||||
.foregroundColor(isCurrentUser ? foregroundColor.opacity(0.85) : .secondary)
|
||||
|
||||
if isCurrentUser {
|
||||
Image(systemName: (message.isViewed ?? false) ? "checkmark.circle.fill" : "checkmark.circle")
|
||||
.font(.system(size: 12, weight: .semibold))
|
||||
.foregroundColor(isCurrentUser ? foregroundColor.opacity(0.85) : .secondary)
|
||||
}
|
||||
.foregroundColor(isCurrentUser ? Color.white.opacity(0.85) : .secondary)
|
||||
}
|
||||
.offset(y: 3) // Move the timestamp view down
|
||||
}
|
||||
.padding(.vertical, 15)
|
||||
.padding(.horizontal, 15)
|
||||
.padding(.vertical, 10)
|
||||
.padding(.horizontal, 12)
|
||||
.background(
|
||||
MessageBubbleShape(
|
||||
decorationsEnabled: areBubbleDecorationsEnabled,
|
||||
showHornsRaw: decorations.showHorns,
|
||||
showLegsRaw: decorations.showLegs
|
||||
)
|
||||
.fill(bubbleColor)
|
||||
.fill(bubbleColor)
|
||||
)
|
||||
.frame(maxWidth: messageBubbleMaxWidth, alignment: isCurrentUser ? .trailing : .leading)
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user