|
|
|
@ -9,30 +9,14 @@ import SwiftUI
|
|
|
|
|
import UIKit
|
|
|
|
|
|
|
|
|
|
struct ShowAllPlayer: View {
|
|
|
|
|
@Binding var isShowingSheet: Bool
|
|
|
|
|
@State var isShowingSheet = false
|
|
|
|
|
@Binding var players: [Player]
|
|
|
|
|
var body: some View {
|
|
|
|
|
Button(action: {
|
|
|
|
|
self.isShowingSheet = true
|
|
|
|
|
}) {
|
|
|
|
|
Text("Afficher les joueurs")
|
|
|
|
|
}
|
|
|
|
|
.sheet(isPresented: $isShowingSheet) {
|
|
|
|
|
PlayerSheetView(isShowingSheet: $isShowingSheet, players: $players)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct PlayerSheetView: View {
|
|
|
|
|
@Environment(\.dismiss) var dismiss
|
|
|
|
|
@Binding var isShowingSheet: Bool
|
|
|
|
|
@Binding var players: [Player]
|
|
|
|
|
|
|
|
|
|
var body: some View {
|
|
|
|
|
VStack {
|
|
|
|
|
/*List(players, id: \.self) { player in
|
|
|
|
|
Text(player.name) // Assumant que Player a une propriété 'name'
|
|
|
|
|
}*/
|
|
|
|
|
Button(action: {
|
|
|
|
|
}) {
|
|
|
|
|
Text("Afficher les joueurs")
|
|
|
|
|
}
|
|
|
|
|
Button(action: {
|
|
|
|
|
self.isShowingSheet = true
|
|
|
|
|
}) {
|
|
|
|
@ -41,9 +25,9 @@ struct PlayerSheetView: View {
|
|
|
|
|
.padding()
|
|
|
|
|
.background(Color.red)
|
|
|
|
|
.cornerRadius(10)
|
|
|
|
|
}
|
|
|
|
|
.sheet(isPresented: $isShowingSheet) {
|
|
|
|
|
AddPlayerView(isPresented: $isShowingSheet, players: $players)
|
|
|
|
|
.sheet(isPresented: $isShowingSheet) {
|
|
|
|
|
AddPlayerView(isPresented: $isShowingSheet, players: $players)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|