From 5c83ec04832f47a7f96a514bdf5cf5d883276632 Mon Sep 17 00:00:00 2001 From: Johan LACHENAL Date: Mon, 13 May 2024 10:46:55 +0200 Subject: [PATCH] =?UTF-8?q?Ajout=20d'une=20prmi=C3=A8re=20version=20de=20l?= =?UTF-8?q?a=20vue=20Ranking=20(d=C3=A9v=20sans=20mac)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- InfoDetailView.swift | 59 ++++++++++++++++++++++++++++++++++++++++++++ RankingView.swift | 9 ++++++- 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 InfoDetailView.swift diff --git a/InfoDetailView.swift b/InfoDetailView.swift new file mode 100644 index 0000000..09cd3a7 --- /dev/null +++ b/InfoDetailView.swift @@ -0,0 +1,59 @@ +import SwiftUI + +struct IgaSwiatekView: View { + var body: some View { + ZStack { + Color.purple.edgesIgnoringSafeArea(.all) + VStack(alignment: .leading, spacing: 20) { + Text("Iga Swiatek") + .font(.largeTitle) + .fontWeight(.bold) + .foregroundColor(.white) + + HStack { + Image(systemName: "flag.fill") + .foregroundColor(.white) + Text("POLAND") + .foregroundColor(.white) + } + + HStack { + VStack(alignment: .leading, spacing: 10) { + Text("Height") + .fontWeight(.semibold) + Text("5' 9\"") + } + Spacer() + VStack(alignment: .leading, spacing: 10) { + Text("Age") + .fontWeight(.semibold) + Text("22") + } + } + .foregroundColor(.white) + + HStack { + VStack(alignment: .leading, spacing: 10) { + Text("Plays") + .fontWeight(.semibold) + Text("Right-Handed") + } + Spacer() + VStack(alignment: .leading, spacing: 10) { + Text("Birthplace") + .fontWeight(.semibold) + Text("Warsaw, Poland") + } + } + .foregroundColor(.white) + } + .padding() + } + } +} + +struct IgaSwiatekView_Previews: PreviewProvider { + static var previews: some View { + IgaSwiatekView() + } +} diff --git a/RankingView.swift b/RankingView.swift index 29e8461..c28037c 100644 --- a/RankingView.swift +++ b/RankingView.swift @@ -1,5 +1,12 @@ import SwiftUI struct RankingView { - + let ranking : Ranking? + let player : Player? + var body : some View { + VStack(alignment: .leading) + Text("RANKING") + Text(ranking.getRank(of:player.id)) + Text("Singles") + } } \ No newline at end of file