You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.3 KiB

//
// MainMenuButton.swift
// ArkitDoushiQi
//
// Created by Johan LACHENAL on 16/05/2024.
//
import SwiftUI
struct ButtonComponent<Content : View>: View {
let content: Content
let title: String
init(title: String, @ViewBuilder content: () -> Content) {
self.title = title
self.content = content()
}
var body: some View {
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
content
} label: {
Text(title)
.frame(maxWidth: .infinity)
.padding(EdgeInsets(top: 10, leading: 32, bottom: 10, trailing: 32))
.controlSize(.large)
.foregroundColor(.white)
}
.buttonBorderShape(.roundedRectangle)
.buttonStyle(.borderedProminent)
.tint(.black)
}
}
struct ButtonComponent_Previews: PreviewProvider {
static var previews: some View {
NavigationView {
VStack {
ButtonComponent(title: "Parties enregistrées") {
Text("Je suis un test")
}
}
}
}
}