Просмотр исходного кода

Adjustements after review @dnzxy
- Footer text in 2 elements
- spelling error fix
and Connect to Tidepool from ontapgesture text -> Action button with blue text for consistency

dsnallfot 2 лет назад
Родитель
Сommit
49c6027799

+ 32 - 29
FreeAPS/Sources/Modules/Settings/View/TidepoolStartView.swift

@@ -6,38 +6,41 @@ struct TidepoolStartView: View {
 
     var body: some View {
         Form {
-            Section {
-                Text("Connect to Tidepool")
-                    .onTapGesture {
-                        state.setupTidepool = true
-                    }
-
-            } footer: {
-                Text(
-                    "When connected, uploading of carbs, bolus, basal and glucose from Trio to your Tidepool account is enabled. \n\nUse your Tidepool credentials to login. If you dont already have a Tidepool account, you can sign up for one on the login page."
-                )
-            }
-        }
-        .sheet(isPresented: $state.setupTidepool) {
-            if let serviceUIType = state.serviceUIType,
-               let pluginHost = state.provider.tidepoolManager.getTidepoolPluginHost()
-            {
-                if let serviceUI = state.provider.tidepoolManager.getTidepoolServiceUI() {
-                    TidepoolSettingsView(
-                        serviceUI: serviceUI,
-                        serviceOnBoardDelegate: self.state,
-                        serviceDelegate: self.state
+            Section(
+                header: Text("Connect to Tidepool"),
+                footer: VStack(alignment: .leading, spacing: 2) {
+                    Text(
+                        "When connected, uploading of carbs, bolus, basal and glucose from Trio to your Tidepool account is enabled."
                     )
-                } else {
-                    TidepoolSetupView(
-                        serviceUIType: serviceUIType,
-                        pluginHost: pluginHost,
-                        serviceOnBoardDelegate: self.state,
-                        serviceDelegate: self.state
+                    Text(
+                        "\nUse your Tidepool credentials to login. If you dont already have a Tidepool account, you can sign up for one on the login page."
                     )
                 }
-            }
+            )
+                {
+                    Button("Connect to Tidepool") { state.setupTidepool = true }
+                }
+                .sheet(isPresented: $state.setupTidepool) {
+                    if let serviceUIType = state.serviceUIType,
+                       let pluginHost = state.provider.tidepoolManager.getTidepoolPluginHost()
+                    {
+                        if let serviceUI = state.provider.tidepoolManager.getTidepoolServiceUI() {
+                            TidepoolSettingsView(
+                                serviceUI: serviceUI,
+                                serviceOnBoardDelegate: self.state,
+                                serviceDelegate: self.state
+                            )
+                        } else {
+                            TidepoolSetupView(
+                                serviceUIType: serviceUIType,
+                                pluginHost: pluginHost,
+                                serviceOnBoardDelegate: self.state,
+                                serviceDelegate: self.state
+                            )
+                        }
+                    }
+                }
+                .navigationTitle("Tidepool")
         }
-        .navigationTitle("Tidepool")
     }
 }

+ 1 - 1
FreeAPS/Sources/Services/Network/TidepoolManager.swift

@@ -54,7 +54,7 @@ final class BaseTidepoolManager: TidepoolManager, Injectable {
         }
     }
 
-    /// allows to acces to tidepoolService as a simple ServiceUI
+    /// allows access to tidepoolService as a simple ServiceUI
     func getTidepoolServiceUI() -> ServiceUI? {
         if let tidepoolService = self.tidepoolService {
             return tidepoolService as! any ServiceUI as ServiceUI