diff --git a/Sources/AllInApp/AllIn/Assets.xcassets/BlueCoinIcon.imageset/Group 107 (1).png b/Sources/AllInApp/AllIn/Assets.xcassets/BlueCoinIcon.imageset/Group 107 (1).png deleted file mode 100644 index d982a56..0000000 Binary files a/Sources/AllInApp/AllIn/Assets.xcassets/BlueCoinIcon.imageset/Group 107 (1).png and /dev/null differ diff --git a/Sources/AllInApp/AllIn/Assets.xcassets/BlueCoinIcon.imageset/Contents.json b/Sources/AllInApp/AllIn/Assets.xcassets/allCoinBlackIcon.imageset/Contents.json similarity index 87% rename from Sources/AllInApp/AllIn/Assets.xcassets/BlueCoinIcon.imageset/Contents.json rename to Sources/AllInApp/AllIn/Assets.xcassets/allCoinBlackIcon.imageset/Contents.json index 67a98bf..679a508 100644 --- a/Sources/AllInApp/AllIn/Assets.xcassets/BlueCoinIcon.imageset/Contents.json +++ b/Sources/AllInApp/AllIn/Assets.xcassets/allCoinBlackIcon.imageset/Contents.json @@ -1,7 +1,7 @@ { "images" : [ { - "filename" : "Group 107 (1).png", + "filename" : "allCoinBlack.png", "idiom" : "universal", "scale" : "1x" }, diff --git a/Sources/AllInApp/AllIn/Assets.xcassets/allCoinBlackIcon.imageset/allCoinBlack.png b/Sources/AllInApp/AllIn/Assets.xcassets/allCoinBlackIcon.imageset/allCoinBlack.png new file mode 100644 index 0000000..46b6e23 Binary files /dev/null and b/Sources/AllInApp/AllIn/Assets.xcassets/allCoinBlackIcon.imageset/allCoinBlack.png differ diff --git a/Sources/AllInApp/AllIn/Assets.xcassets/LoadingHeart.imageset/Contents.json b/Sources/AllInApp/AllIn/Assets.xcassets/loadingHeartIcon.imageset/Contents.json similarity index 100% rename from Sources/AllInApp/AllIn/Assets.xcassets/LoadingHeart.imageset/Contents.json rename to Sources/AllInApp/AllIn/Assets.xcassets/loadingHeartIcon.imageset/Contents.json diff --git a/Sources/AllInApp/AllIn/Assets.xcassets/LoadingHeart.imageset/Group 280.png b/Sources/AllInApp/AllIn/Assets.xcassets/loadingHeartIcon.imageset/Group 280.png similarity index 100% rename from Sources/AllInApp/AllIn/Assets.xcassets/LoadingHeart.imageset/Group 280.png rename to Sources/AllInApp/AllIn/Assets.xcassets/loadingHeartIcon.imageset/Group 280.png diff --git a/Sources/AllInApp/AllIn/Components/BetLineLoading.swift b/Sources/AllInApp/AllIn/Components/BetLineLoading.swift index a250915..73c5d49 100644 --- a/Sources/AllInApp/AllIn/Components/BetLineLoading.swift +++ b/Sources/AllInApp/AllIn/Components/BetLineLoading.swift @@ -38,57 +38,109 @@ struct BetLineLoading: View { GeometryReader { geometry in VStack(alignment: .leading,spacing: 0){ HStack(spacing: 5){ - Text("OUI").font(.system(size: 25)).fontWeight(.bold).foregroundColor(AllInColors.blue200) + Text("OUI") + .font(.system(size: 25)) + .fontWeight(.bold) + .foregroundColor(AllInColors.blue200) Spacer() - Text("NON").font(.system(size: 25)).fontWeight(.bold).foregroundColor(AllInColors.pink100) + Text("NON") + .font(.system(size: 25)) + .fontWeight(.bold) + .foregroundColor(AllInColors.pink100) } ZStack(alignment: .leading) { HStack{ Spacer() - Rectangle().frame(width: min(CGFloat(1-self.value)*geometry.size.width, geometry.size.width), height: 17) + Rectangle() + .frame(width: min(CGFloat(1-self.value)*geometry.size.width, geometry.size.width), height: 17) .foregroundStyle(AllInColors.PinkBetGradiant).cornerRadius(999) } HStack(spacing: 0){ - Rectangle().frame(width: min(CGFloat(self.value)*geometry.size.width, geometry.size.width), height: 17) - .foregroundStyle(AllInColors.BlueBetGradiant).cornerRadius(999) + Rectangle() + .frame(width: min(CGFloat(self.value)*geometry.size.width, geometry.size.width), height: 17) + .foregroundStyle(AllInColors.BlueBetGradiant) + .cornerRadius(999) .animation(.linear) - Image("LoadingHeart").resizable().frame(width: 29, height: 32).padding(.leading, -10) + Image("loadingHeartIcon") + .resizable() + .frame(width: 29, height: 32) + .padding(.leading, -10) } } VStack(spacing: 1){ HStack(spacing: 5){ - Image("BlueAllCoinIcon").resizable().frame(width:12, height: 12) - Text(yesParticipations.reduce(0, {x,y in x + y.stake}).description).font(.system(size: 15)).fontWeight(.bold).foregroundColor(AllInColors.blue200) + Image("blueAllCoinIcon") + .resizable() + .frame(width:12, height: 12) + Text(yesParticipations.reduce(0, {x,y in x + y.stake}).description) + .font(.system(size: 15)) + .fontWeight(.bold) + .foregroundColor(AllInColors.blue200) Spacer() - Text(noParticipations.reduce(0, {x,y in x + y.stake}).description).font(.system(size: 15)).fontWeight(.bold).foregroundColor(AllInColors.pink100) - Image("PinkAllCoinIcon").resizable().frame(width:10, height: 14) + Text(noParticipations.reduce(0, {x,y in x + y.stake}).description) + .font(.system(size: 15)) + .fontWeight(.bold) + .foregroundColor(AllInColors.pink100) + Image("pinkAllCoinIcon") + .resizable() + .frame(width:10, height: 14) } HStack(spacing: 5){ - Image("BluePersonIcon").resizable().frame(width:14, height: 12) - Text(yesParticipations.count.description).font(.system(size: 15)).fontWeight(.bold).foregroundColor(AllInColors.blue200) + Image("bluePersonIcon") + .resizable() + .frame(width:14, height: 12) + Text(yesParticipations.count.description) + .font(.system(size: 15)) + .fontWeight(.bold) + .foregroundColor(AllInColors.blue200) Spacer() - Text(noParticipations.count.description).font(.system(size: 15)).fontWeight(.bold).foregroundColor(AllInColors.pink100) - Image("PinkPersonIcon").resizable().frame(width:10, height: 14) + Text(noParticipations.count.description) + .font(.system(size: 15)) + .fontWeight(.bold) + .foregroundColor(AllInColors.pink100) + Image("pinkPersonIcon") + .resizable() + .frame(width:10, height: 14) } HStack(spacing: 5){ - Image("BlueBadgeIcon").resizable().frame(width:10, height: 14) - Text(yesParticipations.max(by: { $0.stake < $1.stake })?.stake.description ?? "0").font(.system(size: 15)).fontWeight(.bold).foregroundColor(AllInColors.blue200) + Image("blueBadgeIcon") + .resizable() + .frame(width:10, height: 14) + Text(yesParticipations.max(by: { $0.stake < $1.stake })?.stake.description ?? "0") + .font(.system(size: 15)) + .fontWeight(.bold) + .foregroundColor(AllInColors.blue200) Spacer() - Text(noParticipations.max(by: { $0.stake < $1.stake })?.stake.description ?? "0").font(.system(size: 15)).fontWeight(.bold).foregroundColor(AllInColors.pink100) - Image("PinkBadgeIcon").resizable().frame(width:10, height: 14) + Text(noParticipations.max(by: { $0.stake < $1.stake })?.stake.description ?? "0") + .font(.system(size: 15)) + .fontWeight(.bold) + .foregroundColor(AllInColors.pink100) + Image("pinkBadgeIcon") + .resizable() + .frame(width:10, height: 14) } HStack(spacing: 5){ - Image("BlueTrophyIcon").resizable().frame(width:14, height: 13) - Text("1.2").font(.system(size: 15)).fontWeight(.bold).foregroundColor(AllInColors.blue200) + Image("blueTrophyIcon") + .resizable() + .frame(width:14, height: 13) + Text("1.2") + .font(.system(size: 15)) + .fontWeight(.bold) + .foregroundColor(AllInColors.blue200) Spacer() - Text("1.2").font(.system(size: 15)).fontWeight(.bold).foregroundColor(AllInColors.pink100) - Image("PinkTrophyIcon").resizable().frame(width:10, height: 14) + Text("1.2") + .font(.system(size: 15)) + .fontWeight(.bold) + .foregroundColor(AllInColors.pink100) + Image("pinkTrophyIcon") + .resizable() + .frame(width:10, height: 14) } } diff --git a/Sources/AllInApp/AllIn/Components/ParticipationModal.swift b/Sources/AllInApp/AllIn/Components/ParticipationModal.swift index 05f2998..781d0d7 100644 --- a/Sources/AllInApp/AllIn/Components/ParticipationModal.swift +++ b/Sources/AllInApp/AllIn/Components/ParticipationModal.swift @@ -66,13 +66,13 @@ struct ParticipationModal: View { .frame(height: 40) ) .frame(width: .infinity, height: 40) - .foregroundColor(AllInColors.primaryTextColor) + .foregroundColor(.black) .overlay( RoundedRectangle(cornerRadius: 10, style: .continuous) .stroke(AllInColors.delimiterGrey, lineWidth: 1) ) .padding(.bottom, 5) - + } .padding(15) Spacer() @@ -101,6 +101,7 @@ struct ParticipationModal: View { } .buttonStyle(.borderedProminent) .tint(AllInColors.purpleAccentColor) + .disabled(checkAndSetError()) } .padding(.horizontal, 10) @@ -109,4 +110,16 @@ struct ParticipationModal: View { } .background(AllInColors.underComponentBackgroundColor) } + + func checkAndSetError() -> Bool { + if let stake = Int(mise) { + if stake <= AppStateContainer.shared.user?.nbCoins ?? 0 { + return false + } else { + return true + } + } else { + return true + } + } } diff --git a/Sources/AllInApp/AllIn/ViewModels/DetailsViewModel.swift b/Sources/AllInApp/AllIn/ViewModels/DetailsViewModel.swift index 432e1ba..c9054f2 100644 --- a/Sources/AllInApp/AllIn/ViewModels/DetailsViewModel.swift +++ b/Sources/AllInApp/AllIn/ViewModels/DetailsViewModel.swift @@ -48,5 +48,11 @@ class DetailsViewModel: ObservableObject { } } } + mise = "" + answer = 0 + } + + func checkAndSetError() { + } } diff --git a/Sources/AllInApp/AllIn/Views/DetailsView.swift b/Sources/AllInApp/AllIn/Views/DetailsView.swift index 2bd3322..a67ed2a 100644 --- a/Sources/AllInApp/AllIn/Views/DetailsView.swift +++ b/Sources/AllInApp/AllIn/Views/DetailsView.swift @@ -131,10 +131,13 @@ struct DetailsView: View { .foregroundStyle(AllInColors.grey100Color) .fontWeight(.bold) .padding(.bottom, 10) - ForEach(viewModel.betDetail?.participations ?? []) { (participation: Participation) in - ParticiationCell(participation: participation).padding(.horizontal, 10) + ScrollView(showsIndicators: false) { + ForEach(viewModel.betDetail?.participations ?? []) { (participation: Participation) in + ParticiationCell(participation: participation).padding(.horizontal, 10) + } } - + .padding(.bottom, 28) + Spacer() } .frame(maxWidth: /*@START_MENU_TOKEN@*/.infinity/*@END_MENU_TOKEN@*/, maxHeight: .infinity)