diff GeoQuiz/ContentView.swift @ 5:f31a61462e7a

add sound effects
author Dennis C. M. <dennis@denniscm.com>
date Sat, 24 Sep 2022 12:02:09 +0100
parents de54f05adb78
children 1946bbfde4af
line wrap: on
line diff
--- a/GeoQuiz/ContentView.swift	Thu Sep 22 11:38:42 2022 +0200
+++ b/GeoQuiz/ContentView.swift	Sat Sep 24 12:02:09 2022 +0100
@@ -9,7 +9,8 @@
 
 struct ContentView: View {
     @State private var gameName: GameName? = nil
-    @State private var showingBuyLivesModal = false
+    @State private var showingBuyLivesModalView = false
+    @State private var showingSettingsModalView = false
     
     var body: some View {
         NavigationView {
@@ -64,15 +65,29 @@
             }
             .navigationTitle("Select a game 🎮")
             .toolbar {
-                Button {
-                    showingBuyLivesModal = true
-                } label: {
-                    Label("Buy lives", systemImage: "heart.fill")
+                ToolbarItem(placement: .navigationBarLeading) {
+                    Button {
+                        showingSettingsModalView = true
+                    } label: {
+                        Label("Settings", systemImage: "gear")
+                    }
+                }
+                
+                ToolbarItemGroup {
+                    Button {
+                        showingBuyLivesModalView = true
+                    } label: {
+                        Label("Buy lives", systemImage: "heart.fill")
+                    }
                 }
             }
-            .sheet(isPresented: $showingBuyLivesModal) {
+            .sheet(isPresented: $showingBuyLivesModalView) {
                 BuyLivesModalView()
             }
+            
+            .sheet(isPresented: $showingSettingsModalView) {
+                SettingsModalView()
+            }
         }
     }
 }