|
|
|
@ -6,6 +6,8 @@
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
import SwiftUI
|
|
|
|
|
import DouShouQiModel
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct PlayerView: View {
|
|
|
|
|
//var Player : Player;
|
|
|
|
@ -17,102 +19,92 @@ struct PlayerView: View {
|
|
|
|
|
var losses: Int
|
|
|
|
|
var histoMatches : [ Match ]
|
|
|
|
|
|
|
|
|
|
@State var isEdited : Bool = false
|
|
|
|
|
//@ObservedObject var player : PlayerVM //TODO
|
|
|
|
|
|
|
|
|
|
var body: some View {
|
|
|
|
|
ZStack{
|
|
|
|
|
/*Rectangle().fill(Color.orange.opacity(0.1))*/
|
|
|
|
|
NavigationStack{
|
|
|
|
|
VStack{
|
|
|
|
|
Image("Blob")
|
|
|
|
|
.resizable()
|
|
|
|
|
.aspectRatio(contentMode: .fit)
|
|
|
|
|
.clipShape(Circle())
|
|
|
|
|
.overlay(Circle().strokeBorder(Color.orange, lineWidth: 2))
|
|
|
|
|
.scaleEffect(1)
|
|
|
|
|
.transformEffect(.identity)
|
|
|
|
|
|
|
|
|
|
Spacer()
|
|
|
|
|
//ZStack{
|
|
|
|
|
//Rectangle().fill(Color.bgColor).ignoresSafeArea()
|
|
|
|
|
VStack{
|
|
|
|
|
VStack{
|
|
|
|
|
Image("Blob")
|
|
|
|
|
.resizable()
|
|
|
|
|
.aspectRatio(contentMode: .fit)
|
|
|
|
|
.clipShape(Circle())
|
|
|
|
|
.overlay(Circle().strokeBorder(Color.orange, lineWidth: 2))
|
|
|
|
|
.scaleEffect(1)
|
|
|
|
|
.transformEffect(.identity)
|
|
|
|
|
|
|
|
|
|
VStack(alignment: .center){
|
|
|
|
|
Text("\(name) Sname")
|
|
|
|
|
.font(.largeTitle)
|
|
|
|
|
.foregroundColor(Color.white)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Text("1")
|
|
|
|
|
.font(.title2)
|
|
|
|
|
.foregroundColor(Color.white)
|
|
|
|
|
.frame(width: 35, height: 35, alignment: .center)
|
|
|
|
|
.padding(5)
|
|
|
|
|
.overlay(
|
|
|
|
|
Circle()
|
|
|
|
|
.fill(Color.orange.opacity(0.3))
|
|
|
|
|
)
|
|
|
|
|
Spacer()
|
|
|
|
|
|
|
|
|
|
VStack(alignment: .center){
|
|
|
|
|
Text("\(name) Sname")
|
|
|
|
|
.font(.largeTitle)
|
|
|
|
|
.foregroundColor(Color.white)
|
|
|
|
|
|
|
|
|
|
}.frame(width: 200, height: 150)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Text("1")
|
|
|
|
|
.font(.title2)
|
|
|
|
|
.foregroundColor(Color.white)
|
|
|
|
|
.frame(width: 35, height: 35, alignment: .center)
|
|
|
|
|
.padding(5)
|
|
|
|
|
.overlay(
|
|
|
|
|
Circle()
|
|
|
|
|
.fill(Color.orange.opacity(0.3))
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
}.frame(maxWidth: .infinity)
|
|
|
|
|
}.frame(width: 200, height: 150)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}.frame(maxWidth: .infinity)
|
|
|
|
|
.padding(20)
|
|
|
|
|
.background(Color.yellow)
|
|
|
|
|
.background(Color.primaryColor)
|
|
|
|
|
.cornerRadius(50)
|
|
|
|
|
.shadow(color: .gray, radius: 3, x: 2, y: 2)
|
|
|
|
|
.padding(20)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Spacer()
|
|
|
|
|
|
|
|
|
|
VStack{
|
|
|
|
|
Text("Statistiques")
|
|
|
|
|
.fontWeight(.heavy)
|
|
|
|
|
.font(.largeTitle)
|
|
|
|
|
.foregroundColor(Color.primaryColor)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Spacer()
|
|
|
|
|
|
|
|
|
|
VStack{
|
|
|
|
|
Text("Statistiques")
|
|
|
|
|
.fontWeight(.heavy)
|
|
|
|
|
.font(.largeTitle)
|
|
|
|
|
.foregroundColor(Color.yellow)
|
|
|
|
|
|
|
|
|
|
Grid{
|
|
|
|
|
GridRow{
|
|
|
|
|
DoubleTextDisplay(textL: "Nombre de victoires", textR: "9")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GridRow{
|
|
|
|
|
HStack{
|
|
|
|
|
Text("Nombre de défaites").frame(width: 100, height: 50, alignment: .center)
|
|
|
|
|
Text("5")
|
|
|
|
|
}
|
|
|
|
|
} .frame(width: 150)
|
|
|
|
|
.background(Color.orange.opacity(0.3))
|
|
|
|
|
.cornerRadius(15)
|
|
|
|
|
|
|
|
|
|
GridRow{
|
|
|
|
|
HStack{
|
|
|
|
|
Text("Nombre de parties jouées").frame(width: 100, height: 50, alignment: .center)
|
|
|
|
|
Text("14")
|
|
|
|
|
}
|
|
|
|
|
} .frame(width: 150)
|
|
|
|
|
.background(Color.orange.opacity(0.3))
|
|
|
|
|
.cornerRadius(15)
|
|
|
|
|
}.frame(
|
|
|
|
|
minWidth: 0,
|
|
|
|
|
maxWidth: .infinity,
|
|
|
|
|
alignment: .center
|
|
|
|
|
)
|
|
|
|
|
Spacer()
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
.foregroundStyle(.white)
|
|
|
|
|
.overlay(
|
|
|
|
|
RoundedRectangle(cornerRadius: 16)
|
|
|
|
|
.stroke(.yellow, lineWidth: 5)
|
|
|
|
|
)
|
|
|
|
|
.padding(20)
|
|
|
|
|
DoubleTextDisplay(textL: "Nombre de victoires", textR: "9")
|
|
|
|
|
|
|
|
|
|
DoubleTextDisplay(textL: "Nombre de défaites", textR: "5")
|
|
|
|
|
|
|
|
|
|
DoubleTextDisplay(textL: "Nombre de parties jouées", textR: "14")
|
|
|
|
|
|
|
|
|
|
Spacer()
|
|
|
|
|
|
|
|
|
|
NavButton("Historique", destinationView: {HistoryView(playerName: name, matches: histoMatches)})
|
|
|
|
|
.padding(.top, 20)
|
|
|
|
|
}
|
|
|
|
|
.foregroundStyle(.white)
|
|
|
|
|
.overlay(
|
|
|
|
|
RoundedRectangle(cornerRadius: 16)
|
|
|
|
|
.stroke(Color.primaryColor, lineWidth: 5)
|
|
|
|
|
)
|
|
|
|
|
.padding(20)
|
|
|
|
|
|
|
|
|
|
Spacer()
|
|
|
|
|
|
|
|
|
|
NavButton("Historique", destinationView: {HistoryView(playerName: name, matches: histoMatches)})
|
|
|
|
|
.padding(.top, 20)
|
|
|
|
|
}
|
|
|
|
|
.toolbar {
|
|
|
|
|
//ToolbarItemGroup(placement: .bottomBar) {
|
|
|
|
|
Button(action: {isEdited.toggle()}, label: {Text("Edit")})
|
|
|
|
|
//}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.sheet(isPresented: $isEdited, content: {
|
|
|
|
|
Text("CouCou")
|
|
|
|
|
})
|
|
|
|
|
//}//Zstack
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|