AlarmsContainerView.swift 957 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. // LoopFollow
  2. // AlarmsContainerView.swift
  3. import SwiftUI
  4. struct AlarmsContainerView: View {
  5. private let embedsInNavigationStack: Bool
  6. init(embedsInNavigationStack: Bool = true) {
  7. self.embedsInNavigationStack = embedsInNavigationStack
  8. }
  9. var body: some View {
  10. Group {
  11. if embedsInNavigationStack {
  12. NavigationStack {
  13. content
  14. }
  15. } else {
  16. content
  17. }
  18. }
  19. .preferredColorScheme(Storage.shared.appearanceMode.value.colorScheme)
  20. }
  21. private var content: some View {
  22. AlarmListView()
  23. .toolbar {
  24. ToolbarItem(placement: .navigationBarTrailing) {
  25. NavigationLink {
  26. AlarmSettingsView()
  27. } label: {
  28. Image(systemName: "gearshape")
  29. }
  30. }
  31. }
  32. }
  33. }