Merge pull request 'view/details-page' (#15) from view/details-page into feature/display_bet_details
Reviewed-on: #15pull/16/head
commit
d24a1cc244
@ -0,0 +1,38 @@
|
||||
{
|
||||
"colors" : [
|
||||
{
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "0x49",
|
||||
"green" : "0x49",
|
||||
"red" : "0x49"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
},
|
||||
{
|
||||
"appearances" : [
|
||||
{
|
||||
"appearance" : "luminosity",
|
||||
"value" : "dark"
|
||||
}
|
||||
],
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "0x49",
|
||||
"green" : "0x49",
|
||||
"red" : "0x49"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
{
|
||||
"colors" : [
|
||||
{
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "0xF8",
|
||||
"green" : "0x99",
|
||||
"red" : "0x23"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
},
|
||||
{
|
||||
"appearances" : [
|
||||
{
|
||||
"appearance" : "luminosity",
|
||||
"value" : "dark"
|
||||
}
|
||||
],
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "0xF8",
|
||||
"green" : "0x99",
|
||||
"red" : "0x23"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "Vector.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 986 B |
@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "Group 107 (1).png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 681 B |
@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "Group 280.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 3.5 KiB |
@ -0,0 +1,38 @@
|
||||
{
|
||||
"colors" : [
|
||||
{
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "0x8A",
|
||||
"green" : "0x2B",
|
||||
"red" : "0xFE"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
},
|
||||
{
|
||||
"appearances" : [
|
||||
{
|
||||
"appearance" : "luminosity",
|
||||
"value" : "dark"
|
||||
}
|
||||
],
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "0x8A",
|
||||
"green" : "0x2B",
|
||||
"red" : "0xFE"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
{
|
||||
"colors" : [
|
||||
{
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "0xA8",
|
||||
"green" : "0x49",
|
||||
"red" : "0xC2"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
},
|
||||
{
|
||||
"appearances" : [
|
||||
{
|
||||
"appearance" : "luminosity",
|
||||
"value" : "dark"
|
||||
}
|
||||
],
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "0xA8",
|
||||
"green" : "0x49",
|
||||
"red" : "0xC2"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "Vector (1).png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 1008 B |
@ -0,0 +1,38 @@
|
||||
{
|
||||
"colors" : [
|
||||
{
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "0xC5",
|
||||
"green" : "0x66",
|
||||
"red" : "0x8A"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
},
|
||||
{
|
||||
"appearances" : [
|
||||
{
|
||||
"appearance" : "luminosity",
|
||||
"value" : "dark"
|
||||
}
|
||||
],
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "0xC5",
|
||||
"green" : "0x66",
|
||||
"red" : "0x8A"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "Vector (3).png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 1.1 KiB |
@ -0,0 +1,101 @@
|
||||
//
|
||||
// BetLineLoading.swift
|
||||
// AllIn
|
||||
//
|
||||
// Created by Lucas Delanier on 19/01/2024.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import Model
|
||||
|
||||
struct BetLineLoading: View {
|
||||
|
||||
@State var participations: [Participation]
|
||||
|
||||
var value: CGFloat {
|
||||
let totalParticipations = participations.count
|
||||
let numberOfYes = participations.filter { $0.response == "OUI" }.count
|
||||
let numberOfNo = participations.filter { $0.response == "NON" }.count
|
||||
if(numberOfNo == 0 && numberOfYes == 0){
|
||||
return 0.5
|
||||
}
|
||||
|
||||
return totalParticipations > 0 ? CGFloat(numberOfYes) / CGFloat(totalParticipations) : 0.0
|
||||
}
|
||||
|
||||
|
||||
|
||||
var yesParticipations: [Participation] {
|
||||
return participations.filter { $0.response == "OUI" }
|
||||
}
|
||||
|
||||
var noParticipations: [Participation] {
|
||||
return participations.filter { $0.response == "NON" }
|
||||
}
|
||||
|
||||
|
||||
var body: some View {
|
||||
GeometryReader { geometry in
|
||||
VStack(alignment: .leading,spacing: 0){
|
||||
HStack(spacing: 5){
|
||||
Text("OUI").font(.system(size: 25)).fontWeight(.bold).foregroundColor(AllInColors.bleue200)
|
||||
Spacer()
|
||||
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)
|
||||
.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)
|
||||
.animation(.linear)
|
||||
Image("LoadingHeart").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.bleue200)
|
||||
Spacer()
|
||||
Text(noParticipations.reduce(0, {x,y in x + y.stake}).description).font(.system(size: 15)).fontWeight(.bold).foregroundColor(AllInColors.pink100)
|
||||
Image("PinkBadge").resizable().frame(width:10, height: 14)
|
||||
|
||||
}
|
||||
HStack(spacing: 5){
|
||||
Image("BleuePersonIcon").resizable().frame(width:14, height: 12)
|
||||
Text(yesParticipations.count.description).font(.system(size: 15)).fontWeight(.bold).foregroundColor(AllInColors.bleue200)
|
||||
Spacer()
|
||||
Text(noParticipations.count.description).font(.system(size: 15)).fontWeight(.bold).foregroundColor(AllInColors.pink100)
|
||||
Image("PinkBadge").resizable().frame(width:10, height: 14)
|
||||
|
||||
}
|
||||
HStack(spacing: 5){
|
||||
Image("BleueBadge").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.bleue200)
|
||||
Spacer()
|
||||
Text(noParticipations.max(by: { $0.stake < $1.stake })?.stake.description ?? "0").font(.system(size: 15)).fontWeight(.bold).foregroundColor(AllInColors.pink100)
|
||||
Image("PinkBadge").resizable().frame(width:10, height: 14)
|
||||
|
||||
}
|
||||
HStack(spacing: 5){
|
||||
Image("BleueTrophyIcon").resizable().frame(width:14, height: 13)
|
||||
Text("1.2").font(.system(size: 15)).fontWeight(.bold).foregroundColor(AllInColors.bleue200)
|
||||
Spacer()
|
||||
Text("1.2").font(.system(size: 15)).fontWeight(.bold).foregroundColor(AllInColors.pink100)
|
||||
Image("PinkBadge").resizable().frame(width:10, height: 14)
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}.frame(height: 140)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,81 @@
|
||||
//
|
||||
// DropDownAnswerMenu.swift
|
||||
// AllIn
|
||||
//
|
||||
// Created by Lucas Delanier on 16/01/2024.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
//
|
||||
// DropDownMenu.swift
|
||||
// AllIn
|
||||
//
|
||||
// Created by Emre on 19/10/2023.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct DropDownAnswerMenu: View {
|
||||
|
||||
@State var expand = false
|
||||
@Binding var selectedOption: Int
|
||||
var options: [(Int, String, Float)]
|
||||
|
||||
var body: some View {
|
||||
VStack(spacing: 0, content: {
|
||||
Button(action: { self.expand.toggle() }) {
|
||||
HStack{
|
||||
Text(options[selectedOption].1.description)
|
||||
.textStyle(weight: .bold, color: AllInColors.blueAccentColor, size: 20)
|
||||
Text(options[selectedOption].2.description)
|
||||
.textStyle(weight: .bold, color: AllInColors.lightPurpleColor, size: 10)
|
||||
|
||||
Spacer()
|
||||
Image(expand ? "chevronUpIcon" : "chevronDownIcon").resizable().frame(width: 15, height: 10).scaledToFill()
|
||||
}
|
||||
.padding([.leading, .trailing], 15)
|
||||
.frame(height: 43)
|
||||
}
|
||||
if expand {
|
||||
Rectangle()
|
||||
.frame(height: 1)
|
||||
.foregroundColor(AllInColors.delimiterGrey)
|
||||
.padding(.bottom, 18)
|
||||
VStack(spacing: 0) {
|
||||
ForEach(0..<options.count, id: \.self) { index in
|
||||
if options[index].0 != selectedOption {
|
||||
Button(action: {self.selectedOption = options[index].0
|
||||
self.expand.toggle()}) {
|
||||
HStack{
|
||||
Text(options[index].1.description)
|
||||
.textStyle(weight: .bold, color: AllInColors.blueAccentColor, size: 20)
|
||||
Text(options[index].2.description)
|
||||
.textStyle(weight: .bold, color: AllInColors.lightPurpleColor, size: 10)
|
||||
Spacer()
|
||||
}
|
||||
}
|
||||
.padding(.bottom, 15)
|
||||
}
|
||||
}
|
||||
}
|
||||
.padding([.leading, .trailing], 15)
|
||||
}
|
||||
})
|
||||
.frame(width: .infinity)
|
||||
.background(AllInColors.componentBackgroundColor)
|
||||
.cornerRadius(10)
|
||||
}
|
||||
}
|
||||
|
||||
struct DropDownAnswerMenu_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
DropDownAnswerMenu(selectedOption: .constant(0), options: [
|
||||
(0, "questionMarkIcon", 1.2),
|
||||
(1, "footballIcon", 2.2),
|
||||
(2, "paintbrushIcon", 3.3)
|
||||
])
|
||||
.preferredColorScheme(.dark)
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,29 @@
|
||||
//
|
||||
// ParticiationCell.swift
|
||||
// AllIn
|
||||
//
|
||||
// Created by Lucas Delanier on 21/01/2024.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import Model
|
||||
|
||||
struct ParticiationCell: View {
|
||||
@State var participation: Participation?
|
||||
var body: some View {
|
||||
HStack(alignment: .center, spacing: 0){
|
||||
Circle().frame(width: 30, height: 30).foregroundColor(AllInColors.grey700Color).padding(.trailing, 5)
|
||||
Text(participation?.user.username ?? "Unknown")
|
||||
.font(.system(size: 15))
|
||||
.foregroundStyle(AllInColors.grey100Color)
|
||||
.fontWeight(.semibold)
|
||||
Spacer()
|
||||
Text(participation?.stake.description ?? "NaN")
|
||||
.font(.system(size: 18))
|
||||
.foregroundStyle(AllInColors.lightPurpleColor)
|
||||
.fontWeight(.bold).padding(.trailing, 5)
|
||||
Image("PurpleAllCoin").resizable().frame(width: 11, height: 12)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,73 @@
|
||||
//
|
||||
// ParticipationModal.swift
|
||||
// AllIn
|
||||
//
|
||||
// Created by Lucas Delanier on 16/01/2024.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct ParticipationModal: View {
|
||||
@State private var selectedOption = 0
|
||||
@State private var mise: String = ""
|
||||
let options: [(Int, String, Float)] = [
|
||||
(0, "OUI", 1.2),
|
||||
(1, "NON", 3.3),
|
||||
]
|
||||
var body: some View {
|
||||
VStack(alignment: .leading){
|
||||
HStack{
|
||||
Spacer()
|
||||
Rectangle().foregroundStyle(AllInColors.grey800Color).frame(maxWidth: 80, maxHeight: 5).cornerRadius(999)
|
||||
Spacer()
|
||||
|
||||
}.padding(10)
|
||||
HStack{
|
||||
Text("Faites vos paris").font(.system(size: 18)).foregroundColor(AllInColors.blackTitleColor).fontWeight(.semibold)
|
||||
Spacer()
|
||||
AllcoinsCounter(backgroundColor: AllInColors.purpleAccentColor, foregroundColor: AllInColors.whiteColor)
|
||||
}
|
||||
.padding(.leading, 15)
|
||||
VStack(alignment: .leading){
|
||||
Text("Emre va réussir son TP de CI/CD mercredi?").font(.system(size: 13)).foregroundColor(AllInColors.grey100Color).fontWeight(.light)
|
||||
DropDownAnswerMenu(selectedOption: $selectedOption, options: options)
|
||||
TextField("",text: $mise, prompt: Text("Mise")
|
||||
.foregroundColor(AllInColors.lightGrey300Color)
|
||||
.font(.system(size: 14))
|
||||
.fontWeight(.bold))
|
||||
.padding()
|
||||
.keyboardType(.numberPad)
|
||||
.background(
|
||||
RoundedRectangle(cornerRadius: 9)
|
||||
.fill(AllInColors.lightGrey200Color)
|
||||
.frame(height: 40)
|
||||
)
|
||||
.frame(width: .infinity, height: 40)
|
||||
.foregroundColor(AllInColors.primaryTextColor)
|
||||
.overlay(
|
||||
RoundedRectangle(cornerRadius: 10, style: .continuous)
|
||||
.stroke(AllInColors.delimiterGrey, lineWidth: 1)
|
||||
)
|
||||
.padding(.bottom, 5)
|
||||
|
||||
}
|
||||
.padding(15)
|
||||
Spacer()
|
||||
VStack{
|
||||
HStack{
|
||||
Text("Gains possibles").font(.system(size: 13)).foregroundColor(AllInColors.blackTitleColor).fontWeight(.regular)
|
||||
Spacer()
|
||||
Text("231").font(.system(size: 13)).foregroundColor(AllInColors.blackTitleColor).fontWeight(.light)
|
||||
}.padding(.top, 10).padding(.bottom, 0)
|
||||
Button {
|
||||
|
||||
} label: {
|
||||
Text("Miser").font(.system(size: 23)).foregroundColor(AllInColors.whiteColor).fontWeight(.bold)
|
||||
.frame(maxWidth: .infinity).padding(.vertical, 3)
|
||||
}
|
||||
.buttonStyle(.borderedProminent).tint(AllInColors.purpleAccentColor)
|
||||
|
||||
}.padding(.horizontal, 10).background(AllInColors.whiteColor).border(width: 1, edges: [.top], color: AllInColors.delimiterGrey)
|
||||
}.background(AllInColors.underComponentBackgroundColor)
|
||||
}
|
||||
}
|
Loading…
Reference in new issue