From ce4e858cc103100e4b5810827cc98500ba9f9721 Mon Sep 17 00:00:00 2001 From: ludelanier Date: Thu, 6 Jun 2024 13:49:32 +0200 Subject: [PATCH] review cards --- Sources/AllInApp/AllIn/Components/Menu.swift | 5 ++-- .../AllIn/Components/ReviewCard.swift | 23 ++++++++++++------- .../AllIn/Components/userPicture.swift | 4 ++-- Sources/AllInApp/AllInWidgets/Info.plist | 16 +++++++++++++ 4 files changed, 35 insertions(+), 13 deletions(-) diff --git a/Sources/AllInApp/AllIn/Components/Menu.swift b/Sources/AllInApp/AllIn/Components/Menu.swift index df6ea28..333901e 100644 --- a/Sources/AllInApp/AllIn/Components/Menu.swift +++ b/Sources/AllInApp/AllIn/Components/Menu.swift @@ -11,7 +11,7 @@ import DependencyInjection struct Menu: View { @Inject var authService: IAuthService - + let parameters: [(String, String, String, String)] = [ ("videoGameImage", String(localized: "drawer_create_a_bet"), String(localized: "drawer_create_a_bet_subtitle"), "CreationBet"), @@ -24,11 +24,10 @@ struct Menu: View { var body: some View { VStack(alignment: .leading, spacing: 10) { - HStack() { Spacer() VStack(){ - UserPicture(username: (AppStateContainer.shared.user?.username)!, size: 100) + UserPicture(picture: AppStateContainer.shared.user?.image, username: (AppStateContainer.shared.user?.username)!,size: 100) Text(AppStateContainer.shared.user?.username.capitalized ?? "") .fontWeight(.medium) .font(.system(size: 17)) diff --git a/Sources/AllInApp/AllIn/Components/ReviewCard.swift b/Sources/AllInApp/AllIn/Components/ReviewCard.swift index ec6a780..c1825de 100644 --- a/Sources/AllInApp/AllIn/Components/ReviewCard.swift +++ b/Sources/AllInApp/AllIn/Components/ReviewCard.swift @@ -44,19 +44,26 @@ struct ReviewCard: View { VStack(alignment: .center,spacing:0){ HStack(){ Spacer() - Text((betDetail.userParticipation?.stake.description) ?? "") - .foregroundColor(.white) - .font(.system(size: 25)) - .fontWeight(.bold) - Image("allcoinWhiteIcon") - .resizable() - .frame(width: 18, height: 20) + if(betDetail.userParticipation != nil){ + Text((betDetail.userParticipation?.stake.description ?? "")) + .foregroundColor(.white) + .font(.system(size: 25)) + .fontWeight(.bold) + Image("allcoinWhiteIcon") + .resizable() + .frame(width: 18, height: 20) + } switch betDetail.bet.status { - case .waiting, .inProgress, .closing: + case .waiting, .inProgress: Text("bet_status_stake") .foregroundColor(.white) .font(.system(size: 25)) .fontWeight(.bold) + case .closing: + Text("bet_status_finished") + .foregroundColor(.white) + .font(.system(size: 25)) + .fontWeight(.bold) case .finished: Text(amountBetted.description) .foregroundColor(.white) diff --git a/Sources/AllInApp/AllIn/Components/userPicture.swift b/Sources/AllInApp/AllIn/Components/userPicture.swift index 0fc7e81..396f06e 100644 --- a/Sources/AllInApp/AllIn/Components/userPicture.swift +++ b/Sources/AllInApp/AllIn/Components/userPicture.swift @@ -8,14 +8,14 @@ import SwiftUI struct UserPicture: View { - var picture: URL? + var picture: String? var username: String var size: CGFloat var body: some View { ZStack { if picture != nil { AsyncImage( - url: picture, + url: URL(string:picture!), content: { image in image .resizable() diff --git a/Sources/AllInApp/AllInWidgets/Info.plist b/Sources/AllInApp/AllInWidgets/Info.plist index 0f118fb..29c8417 100644 --- a/Sources/AllInApp/AllInWidgets/Info.plist +++ b/Sources/AllInApp/AllInWidgets/Info.plist @@ -7,5 +7,21 @@ NSExtensionPointIdentifier com.apple.widgetkit-extension + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + NSExceptionDomains + + codefirst.iut.uca.fr + + NSExceptionAllowsInsecureHTTPLoads + + NSIncludesSubdomains + + + + +