update design

This commit is contained in:
cheykrym 2025-12-12 01:21:33 +03:00
parent 071d108ffb
commit 7a078f6b51

View File

@ -270,28 +270,29 @@ struct PrivateChatView: View {
let bubbleColor = isCurrentUser ? Color.accentColor : Color(.secondarySystemBackground) let bubbleColor = isCurrentUser ? Color.accentColor : Color(.secondarySystemBackground)
let foregroundColor = isCurrentUser ? Color.white : Color.primary let foregroundColor = isCurrentUser ? Color.white : Color.primary
return VStack(alignment: isCurrentUser ? .trailing : .leading, spacing: 4) { // Use a single HStack with bottom alignment to keep text and time on the same line,
// Message Text // with the time aligning to the bottom.
HStack{ return HStack(alignment: .bottom, spacing: 8) {
Text(contentText(for: message)) Text(contentText(for: message))
.font(.body) .font(.body)
.foregroundColor(foregroundColor) .foregroundColor(foregroundColor)
.multilineTextAlignment(.leading) // Keep text left-aligned within its frame .multilineTextAlignment(.leading)
// Timestamp and Read Status // This view contains the time and the optional checkmark.
// It's pushed to the right by the expanding Text view.
HStack(spacing: 4) { HStack(spacing: 4) {
// NO Spacer here. The parent VStack's alignment handles positioning.
Text(timeText) Text(timeText)
.font(.caption2) .font(.caption2)
.foregroundColor(isCurrentUser ? foregroundColor.opacity(0.85) : .secondary) .foregroundColor(isCurrentUser ? foregroundColor.opacity(0.85) : .secondary)
if isCurrentUser { if isCurrentUser {
Image(systemName: (message.isViewed ?? false) ? "checkmark.checkmark" : "checkmark") Image(systemName: (message.isViewed ?? false) ? "checkmark.circle.fill" : "checkmark.circle")
.font(.system(size: 12, weight: .semibold)) .font(.system(size: 12, weight: .semibold))
.foregroundColor(isCurrentUser ? foregroundColor.opacity(0.85) : .secondary) .foregroundColor(isCurrentUser ? foregroundColor.opacity(0.85) : .secondary)
} }
} }
} // Lower the timestamp slightly to make it look like it's in the corner.
.padding(.bottom, 2)
} }
.padding(.vertical, 10) .padding(.vertical, 10)
.padding(.horizontal, 12) .padding(.horizontal, 12)