edit bubble
This commit is contained in:
parent
b25fa16548
commit
071d108ffb
@ -267,19 +267,30 @@ struct PrivateChatView: View {
|
|||||||
isCurrentUser: Bool
|
isCurrentUser: Bool
|
||||||
) -> some View {
|
) -> some View {
|
||||||
let timeText = timestamp(for: message)
|
let timeText = timestamp(for: message)
|
||||||
|
|
||||||
let bubbleColor = isCurrentUser ? Color.accentColor : Color(.secondarySystemBackground)
|
let bubbleColor = isCurrentUser ? Color.accentColor : Color(.secondarySystemBackground)
|
||||||
|
let foregroundColor = isCurrentUser ? Color.white : Color.primary
|
||||||
|
|
||||||
return VStack(alignment: isCurrentUser ? .trailing : .leading, spacing: 4) {
|
return VStack(alignment: isCurrentUser ? .trailing : .leading, spacing: 4) {
|
||||||
|
// Message Text
|
||||||
|
HStack{
|
||||||
Text(contentText(for: message))
|
Text(contentText(for: message))
|
||||||
.font(.body)
|
.font(.body)
|
||||||
.foregroundColor(isCurrentUser ? .white : .primary)
|
.foregroundColor(foregroundColor)
|
||||||
.multilineTextAlignment(.leading)
|
.multilineTextAlignment(.leading) // Keep text left-aligned within its frame
|
||||||
|
|
||||||
if !timeText.isEmpty {
|
// Timestamp and Read Status
|
||||||
|
HStack(spacing: 4) {
|
||||||
|
// NO Spacer here. The parent VStack's alignment handles positioning.
|
||||||
Text(timeText)
|
Text(timeText)
|
||||||
.font(.caption2)
|
.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(.vertical, 10)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user