diff --git a/enzevalos_iphone/ContactHandler.swift b/enzevalos_iphone/ContactHandler.swift index 82c3d01f7102d31d258702353679b575fd4bf130..7c652f9cbb63b0b13f5f830f7df5b1d61da9a192 100644 --- a/enzevalos_iphone/ContactHandler.swift +++ b/enzevalos_iphone/ContactHandler.swift @@ -24,7 +24,7 @@ import SwiftUI // TODO: Mark displayname as from CNContact class ContactHandler { - static var cartoons = true + static var cartoons = false private let store = CNContactStore() static let handler = ContactHandler() diff --git a/enzevalos_iphone/SwiftUI/Inbox/MailRowView.swift b/enzevalos_iphone/SwiftUI/Inbox/MailRowView.swift index 4d4c6936710b82da2880187db62b422d45b174af..2bab25e847251d2379da3a2fbd938b527b2b1f48 100644 --- a/enzevalos_iphone/SwiftUI/Inbox/MailRowView.swift +++ b/enzevalos_iphone/SwiftUI/Inbox/MailRowView.swift @@ -28,6 +28,55 @@ struct MailRowView <M: DisplayMail>: View { var activateOnTap: Bool = true var body: some View { + body_v2 + } + + private var content: String { + get { + let max = 500 + if mail.subject.count < max { + return mail.subject + "\n" + mail.body.prefix(max - mail.subject.count) + } + return mail.subject + } + } + + private var body_v2: some View { + VStack(alignment: .leading) { + HStack{ + // Sender name + Text(mail.sender.name) + .fontWeight(mail.isRead ? .regular : .medium) + .lineLimit(2) + + Spacer() + + if !mail.displayAttachments.isEmpty { + Image(systemName: "paperclip") + .font(.caption) + .foregroundColor(.secondary) + } + + // Arrival time + Text(mail.date.timeAgoText()) + .font(.caption) + .padding(.trailing, -20) + } + HStack { + avatar + + // Subject + Text(content) + .font(.caption) + .lineLimit(6) + } + .padding(.top, -7) + .frame(height: 65) + } + .foregroundColor(mail.isRead ? .secondary : .primary) + } + + private var body_v1: some View { HStack { avatar