OnboardingNavFooter.swift 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // LoopFollow
  2. // OnboardingNavFooter.swift
  3. import SwiftUI
  4. /// The shared Back / Continue footer used both by the container's chrome and by
  5. /// phases that manage their own internal pages (connect, alarms), so the controls
  6. /// look and behave identically everywhere.
  7. struct OnboardingNavFooter: View {
  8. var continueTitle: String = "Continue"
  9. var continueEnabled: Bool = true
  10. var showBack: Bool = true
  11. var onBack: () -> Void
  12. var onContinue: () -> Void
  13. var body: some View {
  14. HStack {
  15. if showBack {
  16. Button(action: onBack) {
  17. Label("Back", systemImage: "chevron.left")
  18. .font(.body.weight(.medium))
  19. }
  20. .buttonStyle(.bordered)
  21. }
  22. Spacer()
  23. Button(action: onContinue) {
  24. Text(continueTitle)
  25. .font(.body.weight(.semibold))
  26. .frame(minWidth: 120)
  27. }
  28. .buttonStyle(.borderedProminent)
  29. .disabled(!continueEnabled)
  30. }
  31. .padding()
  32. .background(.bar)
  33. }
  34. }