review cards

feature/in-progress-card
Lucas DELANIER 8 months ago
parent 209205c1bd
commit ce4e858cc1

@ -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))

@ -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)

@ -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()

@ -7,5 +7,21 @@
<key>NSExtensionPointIdentifier</key>
<string>com.apple.widgetkit-extension</string>
</dict>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSExceptionDomains</key>
<dict>
<key>codefirst.iut.uca.fr</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
</dict>
</dict>
</dict>
</plist>

Loading…
Cancel
Save