From b09542eb9fac1f13368325a87ea9ece0d5bd0a7c Mon Sep 17 00:00:00 2001 From: "johan.lachenal" Date: Thu, 16 May 2024 11:53:04 +0200 Subject: [PATCH] Update(MainMenu) : add navigation --- .../Preview Content/MainMenu.swift | 74 +++++++++++-------- 1 file changed, 42 insertions(+), 32 deletions(-) diff --git a/ArkitDoushiQi/ArkitDoushiQi/Preview Content/MainMenu.swift b/ArkitDoushiQi/ArkitDoushiQi/Preview Content/MainMenu.swift index 4899134..d80f4fd 100644 --- a/ArkitDoushiQi/ArkitDoushiQi/Preview Content/MainMenu.swift +++ b/ArkitDoushiQi/ArkitDoushiQi/Preview Content/MainMenu.swift @@ -8,40 +8,50 @@ import SwiftUI struct MainMenu: View { + @State private var action: Int? = 0 var body: some View { - VStack { - Spacer() - Button("parties enregistrées"){} - .frame(maxWidth: .infinity) - .padding(EdgeInsets(top: 10, leading: 32, bottom: 10, trailing: 32)) - .buttonStyle(.bordered) - .controlSize(.large) - .foregroundColor(.white) - .background(.black) - .buttonBorderShape(.roundedRectangle) - .clipShape(Capsule()) - Spacer().frame(height: 50) - Button("paramètres"){} - .frame(maxWidth: .infinity) - .padding(EdgeInsets(top: 10, leading: 32, bottom: 10, trailing: 32)) - .buttonStyle(.bordered) - .controlSize(.large) - .foregroundColor(.white) - .background(.black) - .clipShape(Capsule()) - Spacer().frame(height: 50) - Button("jouer"){} - .frame(maxWidth: .infinity) - .padding(EdgeInsets(top: 10, leading: 32, bottom: 10, trailing: 32)) - .buttonStyle(.bordered) - .controlSize(.large) - .foregroundColor(.white) - .background(.black) - .clipShape(Capsule()) - Spacer() + NavigationView { + VStack { + Spacer() + NavigationLink("parties enregistrées"){ + // ici mettre la vue sur les parties enregistrées à la place du texte n'hésite pas à tester sur la preview la navigation ça marche, faire pareil pour les autres + Text("Go to parties enregistrées") + } + .frame(maxWidth: .infinity) + .padding(EdgeInsets(top: 10, leading: 32, bottom: 10, trailing: 32)) + .buttonStyle(.bordered) + .controlSize(.large) + .foregroundColor(.white) + .background(.black) + .buttonBorderShape(.roundedRectangle) + .clipShape(Capsule()) + Spacer().frame(height: 50) + NavigationLink("paramètres"){ + Text("Go to paramètres") + } + .frame(maxWidth: .infinity) + .padding(EdgeInsets(top: 10, leading: 32, bottom: 10, trailing: 32)) + .buttonStyle(.bordered) + .controlSize(.large) + .foregroundColor(.white) + .background(.black) + .clipShape(Capsule()) + Spacer().frame(height: 50) + NavigationLink("jouer"){ + Text("Go to jouer") + } + .frame(maxWidth: .infinity) + .padding(EdgeInsets(top: 10, leading: 32, bottom: 10, trailing: 32)) + .buttonStyle(.bordered) + .controlSize(.large) + .foregroundColor(.white) + .background(.black) + .clipShape(Capsule()) + Spacer() + } + .fixedSize(horizontal: false, vertical: true) + .padding(EdgeInsets(top: 10, leading: 32, bottom: 10, trailing: 32)) } - .fixedSize(horizontal: false, vertical: true) - .padding(EdgeInsets(top: 10, leading: 32, bottom: 10, trailing: 32)) } }