NotificationRowView.swift 731 B

1234567891011121314151617181920212223242526272829303132
  1. //
  2. // NotificationRow.swift
  3. // ntfy.sh
  4. //
  5. // Created by Andrew Cope on 1/15/22.
  6. //
  7. import SwiftUI
  8. struct NotificationRowView: View {
  9. let notification: Notification
  10. var body: some View {
  11. VStack(alignment: .leading, spacing: 0) {
  12. HStack {
  13. Text(notification.title ?? "")
  14. .font(.headline)
  15. .bold()
  16. .lineLimit(1)
  17. Spacer()
  18. Text(notification.shortDateTime())
  19. .font(.subheadline)
  20. .foregroundColor(.gray)
  21. }
  22. Spacer()
  23. Text(notification.message ?? "")
  24. .font(.body)
  25. }
  26. .padding(.all, 4)
  27. }
  28. }