finish component for historic page

view/historic-page
Lucas DELANIER 1 year ago
parent f03e94c0ea
commit c8183310d7

@ -8,6 +8,9 @@
import SwiftUI import SwiftUI
struct ReviewCard: View { struct ReviewCard: View {
var amountBetted: Int
var isAWin: Bool
var body: some View { var body: some View {
VStack(spacing: 0){ VStack(spacing: 0){
VStack(alignment: .leading,spacing: 2){ VStack(alignment: .leading,spacing: 2){
@ -19,7 +22,7 @@ struct ReviewCard: View {
Text("Etudes").font(.system(size: 15)).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) Text("Emre va réussir son TP de CI/CD mercredi?").font(.system(size: 20)).fontWeight(.bold)
HStack{ HStack{
Text("Commence le").font(.system(size: 15)).foregroundColor(AllInColors.grey800Color) Text("Fini le").font(.system(size: 15)).foregroundColor(AllInColors.grey800Color)
TextCapsule() TextCapsule()
TextCapsule() TextCapsule()
Spacer() Spacer()
@ -30,44 +33,38 @@ struct ReviewCard: View {
.padding(.all,15) .padding(.all,15)
.background(AllInColors.componentBackgroundColor).cornerRadius(20, corners: [.topLeft,.topRight]).padding(.bottom,0) .background(AllInColors.componentBackgroundColor).cornerRadius(20, corners: [.topLeft,.topRight]).padding(.bottom,0)
VStack(alignment: .leading,spacing: 2){ VStack(alignment: .center,spacing:0){
HStack{ HStack(){
Spacer()
UsersPreview()
Text(" 4 joueurs en attente").font(.system(size: 15)).foregroundColor(AllInColors.grey800Color).fontWeight(.medium)
Spacer() Spacer()
Text(amountBetted.description)
}.padding(0) .foregroundColor(AllInColors.whiteColor)
Button { .font(.system(size: 25))
} label: {
Text("Participer")
.font(.system(size: 30))
.fontWeight(.bold) .fontWeight(.bold)
.frame(maxWidth: .infinity).padding(10) Image("allcoinWhiteIcon")
.multilineTextAlignment(.center) .resizable()
.overlay { .frame(width: 20, height: 20, alignment: .bottom)
AllInColors.primaryGradient.frame(width: 170) Text(isAWin ? "Gagnés!" : "Perdus!")
.mask( .foregroundColor(AllInColors.whiteColor)
Text("Participer") .font(.system(size: 25))
.font(.system(size: 30)) .fontWeight(.bold)
.fontWeight(.bold) Spacer()
.frame(maxWidth: .infinity).padding(10)
)
}
} }
.accentColor(AllInColors.componentBackgroundColor) .frame(width: .infinity)
.buttonStyle(.borderedProminent).cornerRadius(4.0) .padding(.all,10)
.overlay(
RoundedRectangle(cornerRadius: 12).stroke(AllInColors.delimiterGrey, lineWidth: 1)
).padding([.top],5)
} }
.frame(width: .infinity) .frame(width: .infinity)
.padding(.all,8) .padding(.all,2)
.background(AllInColors.underComponentBackgroundColor) .background(
.cornerRadius(20, corners: [.bottomLeft,.bottomRight]) isAWin ?
AnyView(AllInColors.primaryGradient) :
AnyView(Color.black)
) .cornerRadius(20, corners: [.bottomLeft,.bottomRight])
.border(width: 1, edges: [.top], color: AllInColors.delimiterGrey) .border(width: 1, edges: [.top], color: AllInColors.delimiterGrey)
} }
} }

@ -23,8 +23,8 @@ struct HistoricBetView: View {
.textStyle(weight: .bold, color: AllInColors.grey500Color, size: 25) .textStyle(weight: .bold, color: AllInColors.grey500Color, size: 25)
.padding([.top],15) .padding([.top],15)
VStack(spacing: 20){ VStack(spacing: 20){
ReviewCard() ReviewCard(amountBetted: 110, isAWin: true)
ReviewCard() ReviewCard(amountBetted: 3, isAWin: false)
} }
.padding([.trailing, .leading, .bottom],25) .padding([.trailing, .leading, .bottom],25)
} }

Loading…
Cancel
Save