Kordophone client for iOS and macOS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.0 KiB

3 years ago
import SwiftUI
import KordophoneKit
struct ConversationRow : View {
var conversation: Conversation
var body: some View {
HStack {
Circle()
.frame(width: 10, height: 10)
.padding(4)
.opacity(conversation.unreadCount > 0 ? 1.0 : 0.0)
.foregroundColor(.accentColor)
VStack {
HStack {
Text(conversation.effectiveDisplayName)
Spacer()
Text(conversation.date, style: .time)
}
HStack {
Text(conversation.lastMessagePreview)
.multilineTextAlignment(.leading)
Spacer()
}
}
}
}
}
struct ConversationRow_Previews : PreviewProvider {
static var previews: some View {
Group {
ForEach(Conversation.samples) { convo in
ConversationRow(conversation: convo)
}
}
}
}