edit bubble
This commit is contained in:
parent
b25fa16548
commit
071d108ffb
@ -267,21 +267,32 @@ 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
|
||||
|
||||
return VStack(alignment: isCurrentUser ? .trailing : .leading, spacing: 4) {
|
||||
// Message Text
|
||||
HStack{
|
||||
Text(contentText(for: message))
|
||||
.font(.body)
|
||||
.foregroundColor(isCurrentUser ? .white : .primary)
|
||||
.multilineTextAlignment(.leading)
|
||||
|
||||
if !timeText.isEmpty {
|
||||
.foregroundColor(foregroundColor)
|
||||
.multilineTextAlignment(.leading) // Keep text left-aligned within its frame
|
||||
|
||||
// Timestamp and Read Status
|
||||
HStack(spacing: 4) {
|
||||
// NO Spacer here. The parent VStack's alignment handles positioning.
|
||||
Text(timeText)
|
||||
.font(.caption2)
|
||||
.foregroundColor(isCurrentUser ? Color.white.opacity(0.85) : .secondary)
|
||||
.foregroundColor(isCurrentUser ? foregroundColor.opacity(0.85) : .secondary)
|
||||
|
||||
if isCurrentUser {
|
||||
Image(systemName: (message.isViewed ?? false) ? "checkmark.checkmark" : "checkmark")
|
||||
.font(.system(size: 12, weight: .semibold))
|
||||
.foregroundColor(isCurrentUser ? foregroundColor.opacity(0.85) : .secondary)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.padding(.vertical, 10)
|
||||
.padding(.horizontal, 12)
|
||||
.background(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user