G7StartupView.swift 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. //
  2. // G7StartupView.swift
  3. // CGMBLEKitUI
  4. //
  5. // Created by Pete Schwamb on 9/24/22.
  6. // Copyright © 2022 LoopKit Authors. All rights reserved.
  7. //
  8. import Foundation
  9. import SwiftUI
  10. struct G7StartupView: View {
  11. var didContinue: (() -> Void)?
  12. var didCancel: (() -> Void)?
  13. var body: some View {
  14. VStack(alignment: .center, spacing: 20) {
  15. Spacer()
  16. Text(LocalizedString("Dexcom G7", comment: "Title on WelcomeView"))
  17. .font(.largeTitle)
  18. .fontWeight(.semibold)
  19. VStack(alignment: .center) {
  20. Image(frameworkImage: "g7")
  21. .resizable()
  22. .aspectRatio(contentMode: ContentMode.fit)
  23. .frame(height: 120)
  24. .padding(.horizontal)
  25. }.frame(maxWidth: .infinity)
  26. Text(LocalizedString("Loop can read G7 CGM data, but you must still use the Dexcom G7 App for pairing, calibration, and other sensor management.", comment: "Descriptive text on G7StartupView"))
  27. .fixedSize(horizontal: false, vertical: true)
  28. .foregroundColor(.secondary)
  29. Spacer()
  30. Button(action: { self.didContinue?() }) {
  31. Text(LocalizedString("Continue", comment:"Button title for starting setup"))
  32. .actionButtonStyle(.primary)
  33. }
  34. Button(action: { self.didCancel?() } ) {
  35. Text(LocalizedString("Cancel", comment: "Button text to cancel G7 setup")).padding(.top, 20)
  36. }
  37. }
  38. .padding()
  39. .environment(\.horizontalSizeClass, .compact)
  40. .navigationBarTitle("")
  41. .navigationBarHidden(true)
  42. }
  43. }
  44. struct WelcomeView_Previews: PreviewProvider {
  45. static var previews: some View {
  46. NavigationView {
  47. G7StartupView()
  48. }
  49. .previewDevice("iPod touch (7th generation)")
  50. }
  51. }