From 6f27681e17dfaa44c9d623827b4273df3d837cbb Mon Sep 17 00:00:00 2001 From: "louis.dufour" Date: Mon, 17 Jun 2024 14:40:44 +0200 Subject: [PATCH] Update(NewDesign): fix color --- .../Visuals/ItemCollectionParty.swift | 21 ++++++++++++------- .../Views/PartyEnregistery.swift | 9 +++++++- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Visuals/ItemCollectionParty.swift b/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Visuals/ItemCollectionParty.swift index 61fc0e3..785ce32 100644 --- a/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Visuals/ItemCollectionParty.swift +++ b/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Visuals/ItemCollectionParty.swift @@ -9,7 +9,8 @@ import SwiftUI struct ItemCollectionParty: View { var party: Party - + @Environment(\.colorScheme) var colorScheme + var body: some View { VStack { HStack { @@ -22,19 +23,21 @@ struct ItemCollectionParty: View { HStack(spacing: 10) { HStack { - ProfileComponent(color: Color.purple, profileWidth: 60, profileHeight: 60, image: Image(party.player1Image)) + ProfileComponent(color: Color.white, profileWidth: 60, profileHeight: 60, image: Image(party.player1Image)) VStack(alignment: .leading) { Text(party.player1Name) .fontWeight(.bold) - .foregroundColor(.purple) + .foregroundColor(colorScheme == .dark ? .white : .primary) .lineLimit(1) .minimumScaleFactor(0.5) .frame(maxWidth: .infinity, alignment: .leading) Text(LocalizedStringKey(party.player1Score)) .fontWeight(.bold) - .foregroundColor(party.player1Score == "Défaite" ? .red : .green) // Défaite en rouge, Victoire en vert + .foregroundColor(party.player1Score == "Défaite" ? .red : .green) + .lineLimit(1) + .minimumScaleFactor(0.5) } } @@ -46,23 +49,25 @@ struct ItemCollectionParty: View { VStack(alignment: .trailing) { Text(party.player2Name) .fontWeight(.bold) - .foregroundColor(.purple) + .foregroundColor(colorScheme == .dark ? .white : .primary) .lineLimit(1) .minimumScaleFactor(0.5) .frame(maxWidth: .infinity, alignment: .trailing) Text(LocalizedStringKey(party.player2Score)) .fontWeight(.bold) - .foregroundColor(party.player2Score == "Victoire" ? .green : .red) // Victoire en vert, Défaite en rouge + .foregroundColor(party.player2Score == "Victoire" ? .green : .red) + .lineLimit(1) + .minimumScaleFactor(0.5) } - ProfileComponent(color: Color.purple, profileWidth: 60, profileHeight: 60, image: Image(party.player2Image)) + ProfileComponent(color: Color.white, profileWidth: 60, profileHeight: 60, image: Image(party.player2Image)) } } .padding() .background(Color(UIColor.systemBackground)) .cornerRadius(15) - .shadow(radius: 3) // Réduction de l'ombre pour un effet plus léger + .shadow(radius: 3) } .padding(.horizontal) } diff --git a/ArkitDoushiQi/ArkitDoushiQi/Views/PartyEnregistery.swift b/ArkitDoushiQi/ArkitDoushiQi/Views/PartyEnregistery.swift index f3c9649..c4af4e1 100644 --- a/ArkitDoushiQi/ArkitDoushiQi/Views/PartyEnregistery.swift +++ b/ArkitDoushiQi/ArkitDoushiQi/Views/PartyEnregistery.swift @@ -21,7 +21,14 @@ struct PartyListView: View { .padding(.vertical, 5) .listRowInsets(EdgeInsets()) // Supprimer le padding } - .navigationTitle(LocalizedStringKey("Liste des Parties")) + .navigationTitle("") + .toolbar { + ToolbarItem(placement: .principal) { + Text("Liste des Parties") + .font(.custom("Nuku Nuku", size: 24)) // Appliquer la police personnalisée ici + .foregroundColor(.primary) // Ajustez la couleur selon vos besoins + } + } .frame(maxWidth: .infinity) // Utiliser toute la largeur disponible } }