From 5c83ec04832f47a7f96a514bdf5cf5d883276632 Mon Sep 17 00:00:00 2001 From: Johan LACHENAL Date: Mon, 13 May 2024 10:46:55 +0200 Subject: [PATCH 1/6] =?UTF-8?q?Ajout=20d'une=20prmi=C3=A8re=20version=20de?= =?UTF-8?q?=20la=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 -- 2.36.3 From e52b8db493ae76b8a1bc42cdc07d13196b5fdb4d Mon Sep 17 00:00:00 2001 From: Johan LACHENAL Date: Mon, 13 May 2024 10:50:42 +0200 Subject: [PATCH 2/6] =?UTF-8?q?Mise=20=C3=A0=20jour=20de=20'RankingView.sw?= =?UTF-8?q?ift'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- RankingView.swift | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/RankingView.swift b/RankingView.swift index c28037c..69fefef 100644 --- a/RankingView.swift +++ b/RankingView.swift @@ -5,8 +5,15 @@ struct RankingView { let player : Player? var body : some View { VStack(alignment: .leading) - Text("RANKING") + Text("RANKING") // TODO : penser à créer un style pour les textes + .font(.Title) + .foregroundColor(.white) Text(ranking.getRank(of:player.id)) + .font(.LargeTitle) + .fontWeight(.bold) + .foregroundColor(.white) Text("Singles") + .font(.Title2) + .foregroundColor(.white) } } \ No newline at end of file -- 2.36.3 From 53e3822a054064c92f9b94627c679ce5f0577d45 Mon Sep 17 00:00:00 2001 From: Johan LACHENAL Date: Mon, 13 May 2024 10:52:29 +0200 Subject: [PATCH 3/6] =?UTF-8?q?Mise=20=C3=A0=20jour=20de=20'RankingView.sw?= =?UTF-8?q?ift'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- RankingView.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/RankingView.swift b/RankingView.swift index 69fefef..c93d51f 100644 --- a/RankingView.swift +++ b/RankingView.swift @@ -16,4 +16,12 @@ struct RankingView { .font(.Title2) .foregroundColor(.white) } +} + +// TODO verifier si c'est comme ça qu'on fait les previews (il me semble qu'il faut mettre un # preview plutôt que ça) + +struct IgaSwiatekView_Previews: PreviewProvider { + static var previews: some View { + IgaSwiatekView() + } } \ No newline at end of file -- 2.36.3 From f4cacf843a2f3770fa072fbffb44c74a033e2cbd Mon Sep 17 00:00:00 2001 From: Johan LACHENAL Date: Mon, 13 May 2024 10:53:12 +0200 Subject: [PATCH 4/6] =?UTF-8?q?Mise=20=C3=A0=20jour=20de=20'RankingView.sw?= =?UTF-8?q?ift'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- RankingView.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RankingView.swift b/RankingView.swift index c93d51f..00e6d60 100644 --- a/RankingView.swift +++ b/RankingView.swift @@ -20,8 +20,8 @@ struct RankingView { // TODO verifier si c'est comme ça qu'on fait les previews (il me semble qu'il faut mettre un # preview plutôt que ça) -struct IgaSwiatekView_Previews: PreviewProvider { +struct RankingView_Previews: PreviewProvider { static var previews: some View { - IgaSwiatekView() + RankingView() } } \ No newline at end of file -- 2.36.3 From 52fdd365fde0b1019f52befe78b24f97d008d3ac Mon Sep 17 00:00:00 2001 From: Johan LACHENAL Date: Mon, 13 May 2024 10:54:06 +0200 Subject: [PATCH 5/6] =?UTF-8?q?Mise=20=C3=A0=20jour=20de=20'RankingView.sw?= =?UTF-8?q?ift'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- RankingView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RankingView.swift b/RankingView.swift index 00e6d60..e17b77b 100644 --- a/RankingView.swift +++ b/RankingView.swift @@ -4,7 +4,7 @@ struct RankingView { let ranking : Ranking? let player : Player? var body : some View { - VStack(alignment: .leading) + VStack(alignment: .leading,spacing: 20) Text("RANKING") // TODO : penser à créer un style pour les textes .font(.Title) .foregroundColor(.white) -- 2.36.3 From 84d76c7d56c55ef0695c71c4dad489d473437bd3 Mon Sep 17 00:00:00 2001 From: Johan LACHENAL Date: Mon, 13 May 2024 10:55:05 +0200 Subject: [PATCH 6/6] =?UTF-8?q?Mise=20=C3=A0=20jour=20de=20'RankingView.sw?= =?UTF-8?q?ift'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- RankingView.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/RankingView.swift b/RankingView.swift index e17b77b..e90cfc4 100644 --- a/RankingView.swift +++ b/RankingView.swift @@ -4,7 +4,8 @@ struct RankingView { let ranking : Ranking? let player : Player? var body : some View { - VStack(alignment: .leading,spacing: 20) + VStack(alignment: .leading, spacing: 20) + Color.purple Text("RANKING") // TODO : penser à créer un style pour les textes .font(.Title) .foregroundColor(.white) -- 2.36.3