edit bubble

This commit is contained in:
cheykrym 2025-12-12 01:16:30 +03:00
parent b25fa16548
commit 071d108ffb

View File

@ -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(