Merge pull request 'view/historic-page' (#10) from view/historic-page into master
Reviewed-on: #10feature/display_bets
commit
c47d5a8940
@ -0,0 +1,71 @@
|
|||||||
|
//
|
||||||
|
// BetCard.swift
|
||||||
|
// AllIn
|
||||||
|
//
|
||||||
|
// Created by Lucas on 24/09/2023.
|
||||||
|
//
|
||||||
|
|
||||||
|
import SwiftUI
|
||||||
|
|
||||||
|
struct ReviewCard: View {
|
||||||
|
|
||||||
|
var amountBetted: Int
|
||||||
|
var isAWin: Bool
|
||||||
|
var body: some View {
|
||||||
|
VStack(spacing: 0){
|
||||||
|
VStack(alignment: .leading,spacing: 2){
|
||||||
|
HStack{
|
||||||
|
Spacer()
|
||||||
|
Text("proposé par Lucas").font(.system(size: 10)).foregroundColor(AllInColors.grey800Color)
|
||||||
|
|
||||||
|
}
|
||||||
|
Text("Etudes").font(.system(size: 15)).foregroundColor(AllInColors.grey800Color)
|
||||||
|
Text("Emre va réussir son TP de CI/CD mercredi?").font(.system(size: 20)).fontWeight(.bold)
|
||||||
|
HStack{
|
||||||
|
Text("Fini le").font(.system(size: 15)).foregroundColor(AllInColors.grey800Color)
|
||||||
|
TextCapsule()
|
||||||
|
TextCapsule()
|
||||||
|
Spacer()
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.frame(width: .infinity)
|
||||||
|
.padding(.all,15)
|
||||||
|
.background(AllInColors.componentBackgroundColor).cornerRadius(20, corners: [.topLeft,.topRight]).padding(.bottom,0)
|
||||||
|
|
||||||
|
VStack(alignment: .center,spacing:0){
|
||||||
|
HStack(){
|
||||||
|
Spacer()
|
||||||
|
Text(amountBetted.description)
|
||||||
|
.foregroundColor(AllInColors.whiteColor)
|
||||||
|
.font(.system(size: 25))
|
||||||
|
.fontWeight(.bold)
|
||||||
|
Image("allcoinWhiteIcon")
|
||||||
|
.resizable()
|
||||||
|
.frame(width: 20, height: 20, alignment: .bottom)
|
||||||
|
Text(isAWin ? "Gagnés!" : "Perdus!")
|
||||||
|
.foregroundColor(AllInColors.whiteColor)
|
||||||
|
.font(.system(size: 25))
|
||||||
|
.fontWeight(.bold)
|
||||||
|
Spacer()
|
||||||
|
|
||||||
|
}
|
||||||
|
.frame(width: .infinity)
|
||||||
|
.padding(.all,10)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
.frame(width: .infinity)
|
||||||
|
.padding(.all,2)
|
||||||
|
.background(
|
||||||
|
isAWin ?
|
||||||
|
AnyView(AllInColors.primaryGradient) :
|
||||||
|
AnyView(Color.black)
|
||||||
|
) .cornerRadius(20, corners: [.bottomLeft,.bottomRight])
|
||||||
|
.border(width: 1, edges: [.top], color: AllInColors.delimiterGrey)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,37 @@
|
|||||||
|
//
|
||||||
|
// BetView.swift
|
||||||
|
// AllIn
|
||||||
|
//
|
||||||
|
// Created by Lucas on 22/09/2023.
|
||||||
|
//
|
||||||
|
|
||||||
|
import SwiftUI
|
||||||
|
|
||||||
|
struct HistoricBetView: View {
|
||||||
|
|
||||||
|
@StateObject private var viewModel = BetViewModel()
|
||||||
|
@Binding var showMenu: Bool
|
||||||
|
@State private var showingSheet = false
|
||||||
|
|
||||||
|
var body: some View {
|
||||||
|
|
||||||
|
VStack(alignment: .center, spacing: 0) {
|
||||||
|
|
||||||
|
TopBar(showMenu: self.$showMenu)
|
||||||
|
ScrollView(showsIndicators: false) {
|
||||||
|
Text("Historique")
|
||||||
|
.textStyle(weight: .bold, color: AllInColors.grey500Color, size: 25)
|
||||||
|
.padding([.top],15)
|
||||||
|
VStack(spacing: 20){
|
||||||
|
ReviewCard(amountBetted: 110, isAWin: true)
|
||||||
|
ReviewCard(amountBetted: 3, isAWin: false)
|
||||||
|
}
|
||||||
|
.padding([.trailing, .leading, .bottom],25)
|
||||||
|
}
|
||||||
|
Spacer()
|
||||||
|
}
|
||||||
|
.edgesIgnoringSafeArea(.bottom)
|
||||||
|
.background(AllInColors.backgroundColor)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in new issue