Compare commits

..

4 Commits

Author SHA1 Message Date
59a1c6e035 add bubble padding 2025-12-12 01:30:12 +03:00
66ca1bb130 putch bubble 2025-12-12 01:25:07 +03:00
7a078f6b51 update design 2025-12-12 01:21:33 +03:00
071d108ffb edit bubble 2025-12-12 01:16:30 +03:00

View File

@ -267,30 +267,41 @@ 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) { // 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) {
Text(contentText(for: message)) Text(contentText(for: message))
.font(.body) .font(.body)
.foregroundColor(isCurrentUser ? .white : .primary) .foregroundColor(foregroundColor)
.multilineTextAlignment(.leading) .multilineTextAlignment(.leading)
if !timeText.isEmpty { // This view contains the time and the optional checkmark.
// It's pushed to the right by the expanding Text view.
HStack(spacing: 4) {
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.circle.fill" : "checkmark.circle")
.font(.system(size: 12, weight: .semibold))
.foregroundColor(isCurrentUser ? foregroundColor.opacity(0.85) : .secondary)
}
} }
.offset(y: 3) // Move the timestamp view down
} }
.padding(.vertical, 10) .padding(.vertical, 15)
.padding(.horizontal, 12) .padding(.horizontal, 15)
.background( .background(
MessageBubbleShape( MessageBubbleShape(
decorationsEnabled: areBubbleDecorationsEnabled, decorationsEnabled: areBubbleDecorationsEnabled,
showHornsRaw: decorations.showHorns, showHornsRaw: decorations.showHorns,
showLegsRaw: decorations.showLegs showLegsRaw: decorations.showLegs
) )
.fill(bubbleColor) .fill(bubbleColor)
) )
.frame(maxWidth: messageBubbleMaxWidth, alignment: isCurrentUser ? .trailing : .leading) .frame(maxWidth: messageBubbleMaxWidth, alignment: isCurrentUser ? .trailing : .leading)
.fixedSize(horizontal: false, vertical: true) .fixedSize(horizontal: false, vertical: true)