Bläddra i källkod

Improve readability with left text justification for welcome screen

Deniz Cengiz 1 år sedan
förälder
incheckning
4dcc9ceb4c

+ 71 - 0
Trio/Sources/Modules/Onboarding/View/OnboardingSteps/StartupGuide/StartupExistingUserStepView.swift

@@ -0,0 +1,71 @@
+//
+//  StartupGuideStepView.swift
+//  Trio
+//
+//  Created by Cengiz Deniz on 06.04.25.
+//
+import SwiftUI
+
+struct StartupGuideStepView: View {
+    @Bindable var state: Onboarding.StateModel
+
+    @Environment(\.openURL) var openURL
+
+    var body: some View {
+        VStack(alignment: .leading, spacing: 20) {
+            Text("Before you begin…")
+                .padding(.horizontal)
+                .font(.title3)
+                .bold()
+
+            VStack(alignment: .leading, spacing: 10) {
+                BulletPoint(String(localized: "Take a deep breath — you've got this."))
+                BulletPoint(String(localized: "There's no rush. Take all the time you need."))
+                BulletPoint(String(localized: "Everything you enter here can be adjusted later in the app."))
+                BulletPoint(String(localized: "Want a hand? You can open our full Startup Guide here:"))
+
+                Button {
+                    openURL(URL(string: "https://triodocs.org/startup-guide")!)
+                } label: {
+                    Text("https://triodocs.org/startup-guide")
+                        .padding(.horizontal, 12)
+                        .padding(.vertical, 8)
+                        .background(Color.blue.opacity(0.2))
+                        .cornerRadius(8)
+                }
+                .frame(maxWidth: .infinity, alignment: .center)
+                .padding(.horizontal)
+            }.padding(.horizontal)
+
+            VStack(alignment: .leading, spacing: 10) {
+                Text("Already using Trio and updating from an older version?").bold()
+                BulletPoint(String(localized: "Your therapy settings, pump, and CGM configurations will be carried over."))
+                BulletPoint(
+                    String(
+                        localized: "Your algorithm settings (previously called \"OpenAPS settings\") will be reset to defaults."
+                    )
+                )
+                BulletPoint(String(localized: "We recommend reviewing them carefully — Trio will guide you step-by-step."))
+            }.padding(.horizontal)
+
+            VStack(alignment: .leading, spacing: 10) {
+                Text("One last thing, before you begin...").bold()
+                HStack {
+                    Text("You can pause at any time. Just be aware: if you ")
+                        + Text("force quit").bold()
+                        + Text(" the app before finishing onboarding, ")
+                        + Text("your progress will not be saved.").bold()
+                }
+            }.multilineTextAlignment(.leading)
+                .padding(.horizontal)
+
+            Divider()
+
+            Toggle(isOn: $state.hasReadImportantStartupNotes) {
+                Text("Got it! I'm ready to continue.").padding(.leading, 6).bold()
+            }
+            .toggleStyle(CheckboxToggleStyle(tint: Color.blue))
+            .padding(.horizontal)
+        }
+    }
+}

+ 22 - 18
Trio/Sources/Modules/Onboarding/View/OnboardingSteps/WelcomeStepView.swift

@@ -8,27 +8,31 @@ struct WelcomeStepView: View {
 
             Spacer(minLength: 10)
 
-            Text("Hi there!")
-                .font(.title2)
-                .fontWeight(.bold)
-                .multilineTextAlignment(.center)
+            VStack(alignment: .leading, spacing: 20) {
+                Text("Hi there!")
+                    .font(.title2)
+                    .fontWeight(.bold)
+                    .multilineTextAlignment(.center)
 
-            Text(
-                "Welcome to Trio - an automated insulin delivery system for iOS based on the OpenAPS algorithm with adaptations."
-            )
-            .multilineTextAlignment(.center)
-            .foregroundColor(.secondary)
+                Text(
+                    "Welcome to Trio - an automated insulin delivery system for iOS based on the OpenAPS algorithm with adaptations."
+                )
+                .multilineTextAlignment(.leading)
+                .foregroundColor(.secondary)
 
-            Text(
-                "Trio is designed to help manage your diabetes efficiently. To get the most out of the app, we'll guide you through setting up some essential parameters."
-            )
-            .multilineTextAlignment(.center)
-            .foregroundColor(.secondary)
+                Text(
+                    "Trio is designed to help manage your diabetes efficiently. To get the most out of the app, we'll guide you through setting up some essential parameters."
+                )
+                .multilineTextAlignment(.leading)
+                .foregroundColor(.secondary)
 
-            Text("Let's go through a few quick steps to ensure Trio works optimally for you.")
-                .multilineTextAlignment(.center)
-                .foregroundColor(.primary)
-                .bold()
+                Text("Let's go through a few quick steps to ensure Trio works optimally for you.")
+                    .multilineTextAlignment(.leading)
+                    .foregroundColor(.primary)
+                    .bold()
+            }
+            .padding()
+            .frame(maxWidth: .infinity, alignment: .leading)
         }
         .padding()
         .frame(maxWidth: .infinity)