diff GeoQuiz/SettingsModalView.swift @ 19:f140bb277c96

refactor code
author Dennis C. M. <dennis@denniscm.com>
date Sun, 23 Oct 2022 00:11:38 +0100
parents 136928bae534
children e281791e0494
line wrap: on
line diff
--- a/GeoQuiz/SettingsModalView.swift	Sat Oct 22 08:56:54 2022 +0100
+++ b/GeoQuiz/SettingsModalView.swift	Sun Oct 23 00:11:38 2022 +0100
@@ -8,7 +8,8 @@
 import SwiftUI
 
 struct SettingsModalView: View {
-    @ObservedObject var user: User
+    @ObservedObject var user: UserController
+    
     @Environment(\.dismiss) var dismiss
 
     var lives: [Int] {
@@ -21,7 +22,7 @@
     }
     
     var body: some View {
-        NavigationView {
+        NavigationStack {
             Form {
                 Section {
                     Picker("❤️ Lives", selection: $user.data.numberOfLives) {
@@ -46,21 +47,21 @@
                 Section {
                     LinkComponent(
                         color: .mayaBlue,
-                        iconName: "info.circle.fill",
+                        symbol: "info.circle.fill",
                         text: "About",
                         url: URL(string: "https://dennistech.io")!
                     )
                     
                     LinkComponent(
                         color: .atomicTangerine,
-                        iconName: "ant.circle.fill",
+                        symbol: "ant.circle.fill",
                         text: "Report bugs",
                         url: URL(string: "mailto:dmartin@dennistech.io")!
                     )
                     
                     LinkComponent(
                         color: .blueBell,
-                        iconName: "message.circle.fill",
+                        symbol: "message.circle.fill",
                         text: "Twitter",
                         url: URL(string: "https://twitter.com/dennistech_")!
                     )
@@ -69,6 +70,7 @@
                 }
             }
             .navigationTitle("Settings")
+            .navigationBarTitleDisplayMode(.inline)
             .toolbar {
                 ToolbarItem(placement: .cancellationAction) {
                     Button {
@@ -84,6 +86,6 @@
 
 struct SettingsModalView_Previews: PreviewProvider {
     static var previews: some View {
-        SettingsModalView(user: User())
+        SettingsModalView(user: UserController())
     }
 }