Update(MainMenu) : add navigation

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

@ -8,40 +8,50 @@
import SwiftUI import SwiftUI
struct MainMenu: View { struct MainMenu: View {
@State private var action: Int? = 0
var body: some View { var body: some View {
VStack { NavigationView {
Spacer() VStack {
Button("parties enregistrées"){} Spacer()
.frame(maxWidth: .infinity) NavigationLink("parties enregistrées"){
.padding(EdgeInsets(top: 10, leading: 32, bottom: 10, trailing: 32)) // 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
.buttonStyle(.bordered) Text("Go to parties enregistrées")
.controlSize(.large) }
.foregroundColor(.white) .frame(maxWidth: .infinity)
.background(.black) .padding(EdgeInsets(top: 10, leading: 32, bottom: 10, trailing: 32))
.buttonBorderShape(.roundedRectangle) .buttonStyle(.bordered)
.clipShape(Capsule()) .controlSize(.large)
Spacer().frame(height: 50) .foregroundColor(.white)
Button("paramètres"){} .background(.black)
.frame(maxWidth: .infinity) .buttonBorderShape(.roundedRectangle)
.padding(EdgeInsets(top: 10, leading: 32, bottom: 10, trailing: 32)) .clipShape(Capsule())
.buttonStyle(.bordered) Spacer().frame(height: 50)
.controlSize(.large) NavigationLink("paramètres"){
.foregroundColor(.white) Text("Go to paramètres")
.background(.black) }
.clipShape(Capsule()) .frame(maxWidth: .infinity)
Spacer().frame(height: 50) .padding(EdgeInsets(top: 10, leading: 32, bottom: 10, trailing: 32))
Button("jouer"){} .buttonStyle(.bordered)
.frame(maxWidth: .infinity) .controlSize(.large)
.padding(EdgeInsets(top: 10, leading: 32, bottom: 10, trailing: 32)) .foregroundColor(.white)
.buttonStyle(.bordered) .background(.black)
.controlSize(.large) .clipShape(Capsule())
.foregroundColor(.white) Spacer().frame(height: 50)
.background(.black) NavigationLink("jouer"){
.clipShape(Capsule()) Text("Go to jouer")
Spacer() }
.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))
} }
} }

Loading…
Cancel
Save