NotificationPermissionStepView.swift 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. //
  2. // NotificationPermissionStepView.swift
  3. // Trio
  4. //
  5. // Created by Cengiz Deniz on 18.04.25.
  6. //
  7. import SwiftUI
  8. import UserNotifications
  9. struct NotificationPermissionStepView: View {
  10. var body: some View {
  11. VStack(alignment: .leading, spacing: 20) {
  12. Text("Allow Notifications")
  13. .font(.title3)
  14. .bold()
  15. .multilineTextAlignment(.leading)
  16. Text(
  17. "Trio can notify of different events when you use it. You must allow Trio to send you notifications to work properly."
  18. )
  19. .font(.body)
  20. .multilineTextAlignment(.leading)
  21. .foregroundColor(Color.secondary)
  22. .padding(.bottom)
  23. VStack(alignment: .leading, spacing: 20) {
  24. HStack(spacing: 12) {
  25. Image(systemName: "ellipsis.message.fill")
  26. .font(.system(size: 24))
  27. .foregroundColor(Color.bgDarkBlue)
  28. .frame(width: 44, height: 44)
  29. .background(Circle().fill(Color.primary.opacity(0.8)))
  30. Text("Receive optional real‑time low/high glucose alerts.")
  31. .font(.body)
  32. .foregroundColor(.primary)
  33. }
  34. HStack(spacing: 12) {
  35. Image(systemName: "exclamationmark.triangle.fill")
  36. .font(.system(size: 24))
  37. .foregroundColor(Color.bgDarkBlue)
  38. .frame(width: 44, height: 44)
  39. .background(Circle().fill(Color.primary.opacity(0.8)))
  40. Text("Be warned of connectivity or looping issues.")
  41. .font(.body)
  42. .foregroundColor(.primary)
  43. }
  44. HStack(spacing: 12) {
  45. Image(systemName: "app.badge.fill")
  46. .font(.system(size: 24))
  47. .foregroundColor(Color.bgDarkBlue)
  48. .frame(width: 44, height: 44)
  49. .background(Circle().fill(Color.primary.opacity(0.8)))
  50. Text("See a badge count when you need a carb correction.")
  51. .font(.body)
  52. .foregroundColor(.primary)
  53. }
  54. }
  55. Text("You can change these permissions any time in the iOS Settings app.")
  56. .font(.footnote)
  57. .multilineTextAlignment(.leading)
  58. .foregroundColor(Color.secondary)
  59. .padding(.top)
  60. }.padding(.horizontal)
  61. }
  62. }