Update(MainMenu) : add navigation

pull/11/head
Johan LACHENAL 1 year ago
parent 28df688dad
commit b09542eb9f

@ -8,10 +8,15 @@
import SwiftUI import SwiftUI
struct MainMenu: View { struct MainMenu: View {
@State private var action: Int? = 0
var body: some View { var body: some View {
NavigationView {
VStack { VStack {
Spacer() Spacer()
Button("parties enregistrées"){} 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) .frame(maxWidth: .infinity)
.padding(EdgeInsets(top: 10, leading: 32, bottom: 10, trailing: 32)) .padding(EdgeInsets(top: 10, leading: 32, bottom: 10, trailing: 32))
.buttonStyle(.bordered) .buttonStyle(.bordered)
@ -21,7 +26,9 @@ struct MainMenu: View {
.buttonBorderShape(.roundedRectangle) .buttonBorderShape(.roundedRectangle)
.clipShape(Capsule()) .clipShape(Capsule())
Spacer().frame(height: 50) Spacer().frame(height: 50)
Button("paramètres"){} NavigationLink("paramètres"){
Text("Go to paramètres")
}
.frame(maxWidth: .infinity) .frame(maxWidth: .infinity)
.padding(EdgeInsets(top: 10, leading: 32, bottom: 10, trailing: 32)) .padding(EdgeInsets(top: 10, leading: 32, bottom: 10, trailing: 32))
.buttonStyle(.bordered) .buttonStyle(.bordered)
@ -30,7 +37,9 @@ struct MainMenu: View {
.background(.black) .background(.black)
.clipShape(Capsule()) .clipShape(Capsule())
Spacer().frame(height: 50) Spacer().frame(height: 50)
Button("jouer"){} NavigationLink("jouer"){
Text("Go to jouer")
}
.frame(maxWidth: .infinity) .frame(maxWidth: .infinity)
.padding(EdgeInsets(top: 10, leading: 32, bottom: 10, trailing: 32)) .padding(EdgeInsets(top: 10, leading: 32, bottom: 10, trailing: 32))
.buttonStyle(.bordered) .buttonStyle(.bordered)
@ -43,6 +52,7 @@ struct MainMenu: View {
.fixedSize(horizontal: false, vertical: true) .fixedSize(horizontal: false, vertical: true)
.padding(EdgeInsets(top: 10, leading: 32, bottom: 10, trailing: 32)) .padding(EdgeInsets(top: 10, leading: 32, bottom: 10, trailing: 32))
} }
}
} }
struct MainMenu_Previews: PreviewProvider { struct MainMenu_Previews: PreviewProvider {

Loading…
Cancel
Save