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.
35 lines
885 B
35 lines
885 B
//
|
|
// EditModalView.swift
|
|
// DouShouQiIOS
|
|
//
|
|
// Created by Pierre FERREIRA on 03/06/2024.
|
|
//
|
|
|
|
import SwiftUI
|
|
import DouShouQiModel
|
|
|
|
/// EditModalView
|
|
/// Cette vue modale est utilisée pour éditer un joueur
|
|
struct EditModalView: View {
|
|
|
|
var playerVM : PlayerVM
|
|
@Binding var isEdited : Bool
|
|
var name : String = ""
|
|
var body: some View {
|
|
VStack{
|
|
TextField("Entrez un nom ici",text: .constant(""))
|
|
|
|
}.padding()
|
|
.toolbar {
|
|
Button(action: {playerVM.onEdited()}, label: {Text("Done")})
|
|
Button(action: {playerVM.onEdited(isCanceled: true)}, label: {Text("Cancel")})
|
|
}
|
|
}
|
|
}
|
|
|
|
struct EditModalView_Previews: PreviewProvider {
|
|
static var previews: some View {
|
|
EditModalView(playerVM: PlayerVM(with:Player(withName: "toto", andId: .player2)!), isEdited: .constant(true))
|
|
}
|
|
}
|