Merge pull request 'ParametersMenuView' (#14) from ParametersMenuView into dev

Reviewed-on: #14
pull/18/head
Johan LACHENAL 11 months ago
commit 97710112bf

@ -35,7 +35,7 @@ struct DoushiQiPicker<EnumType: RawRepresentable & Identifiable & Hashable>: Vie
Text(title) Text(title)
.foregroundColor(.black) .foregroundColor(.black)
.padding() .padding()
Spacer() // .frame(width : (20 - CGFloat(title.count))) Spacer()
Text(selectedOption.rawValue.description) Text(selectedOption.rawValue.description)
.foregroundColor(.black) .foregroundColor(.black)
.padding() .padding()

@ -8,37 +8,42 @@
import SwiftUI import SwiftUI
struct MainMenu: View { struct MainMenu: View {
let playButtonText : String
let registeredGamesButtonText : String
let ParametersButtontText : String
@State private var action: Int? = 0 @State private var action: Int? = 0
@AppStorage("isDarkMode") private var isDarkMode = false @AppStorage("isDarkMode") private var isDarkMode = false
var body: some View { var body: some View {
VStack { ZStack {
NavigationView { NavigationView {
VStack(alignment: .trailing) { VStack {
HStack(alignment: .top) { Spacer()
Text("DouShiQi").frame(maxHeight: .infinity) HStack() {
Text("DouShiQi")
.bold() .bold()
.font(.title) .font(.title).padding()
}.frame(maxWidth: .infinity,maxHeight: .infinity) }
Spacer().frame(maxWidth: .infinity,maxHeight: .infinity)
Spacer().frame(height: 40) Spacer().frame(height: 40)
MainMenuButton(title: "jouer") VStack(alignment: .leading) {
MainMenuButton(title: playButtonText)
{ Text("jeu page") } { Text("jeu page") }
MainMenuButton(title: "parties enregistrées") Spacer().frame(height: 30)
MainMenuButton(title: registeredGamesButtonText)
{ Text("parties enregistrées page") } { Text("parties enregistrées page") }
MainMenuButton(title: "paramètres") Spacer().frame(height: 30)
MainMenuButton(title: ParametersButtontText)
{ ParametersMenuView() } { ParametersMenuView() }
}
Spacer() Spacer()
} }
.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))
.frame(maxWidth: .infinity,maxHeight: .infinity) }
}.frame(maxWidth: .infinity,maxHeight: .infinity) }
}.frame(maxWidth: .infinity,maxHeight: .infinity)
} }
} }
struct MainMenu_Previews: PreviewProvider { struct MainMenu_Previews: PreviewProvider {
static var previews: some View { static var previews: some View {
MainMenu() MainMenu(playButtonText: "Jouer", registeredGamesButtonText: "Parties enregistrées",ParametersButtontText: "Paramètres")
} }
} }

@ -17,19 +17,19 @@ struct MainMenuButton<Content : View>: View {
} }
var body: some View { var body: some View {
NavigationLink(title){ NavigationLink {
// 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 // 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
content content
} } label: {
Text(title)
.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)
.controlSize(.large) .controlSize(.large)
.foregroundColor(.white) .foregroundColor(.white)
.background(.black) }
.buttonBorderShape(.roundedRectangle) .buttonBorderShape(.roundedRectangle)
.clipShape(Capsule()) .buttonStyle(.borderedProminent)
Spacer().frame(height: 50) .tint(.black)
} }
} }

Loading…
Cancel
Save