diff --git a/Sources/AllInApp/AllIn/Components/Menu.swift b/Sources/AllInApp/AllIn/Components/Menu.swift index d8464f2..29804cf 100644 --- a/Sources/AllInApp/AllIn/Components/Menu.swift +++ b/Sources/AllInApp/AllIn/Components/Menu.swift @@ -70,7 +70,7 @@ struct Menu: View { .padding([.leading,.trailing], 13) } - NavigationLink(destination: MainView(page: "Ranking").navigationBarBackButtonHidden(true)) + NavigationLink(destination: MainView(page: "Historic").navigationBarBackButtonHidden(true)) { ParameterMenu(image: "eyesImage", title: "HISTORIQUE DES BETS", description: "Consultez vos paris en cours et terminés.") .padding([.leading,.trailing], 13) diff --git a/Sources/AllInApp/AllIn/Components/ReviewCard.swift b/Sources/AllInApp/AllIn/Components/ReviewCard.swift index 14f621b..c270b8c 100644 --- a/Sources/AllInApp/AllIn/Components/ReviewCard.swift +++ b/Sources/AllInApp/AllIn/Components/ReviewCard.swift @@ -1,18 +1,74 @@ // -// ReviewCard.swift +// BetCard.swift // AllIn // -// Created by Lucas Delanier on 10/01/2024. +// Created by Lucas on 24/09/2023. // import SwiftUI struct ReviewCard: View { var body: some View { - Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) + 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("Commence 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: .leading,spacing: 2){ + HStack{ + Spacer() + UsersPreview() + Text(" 4 joueurs en attente").font(.system(size: 15)).foregroundColor(AllInColors.grey800Color).fontWeight(.medium) + + Spacer() + + }.padding(0) + Button { + + } label: { + Text("Participer") + .font(.system(size: 30)) + .fontWeight(.bold) + .frame(maxWidth: .infinity).padding(10) + .multilineTextAlignment(.center) + .overlay { + AllInColors.primaryGradient.frame(width: 170) + .mask( + Text("Participer") + .font(.system(size: 30)) + .fontWeight(.bold) + .frame(maxWidth: .infinity).padding(10) + ) + } + } + .accentColor(AllInColors.componentBackgroundColor) + .buttonStyle(.borderedProminent).cornerRadius(4.0) + .overlay( + RoundedRectangle(cornerRadius: 12).stroke(AllInColors.delimiterGrey, lineWidth: 1) + ).padding([.top],5) + + } + .frame(width: .infinity) + .padding(.all,8) + .background(AllInColors.underComponentBackgroundColor) + .cornerRadius(20, corners: [.bottomLeft,.bottomRight]) + .border(width: 1, edges: [.top], color: AllInColors.delimiterGrey) + } } } - -#Preview { - ReviewCard() -} diff --git a/Sources/AllInApp/AllIn/Views/HistoricBetView.swift b/Sources/AllInApp/AllIn/Views/HistoricBetView.swift index d7a3d03..01260f7 100644 --- a/Sources/AllInApp/AllIn/Views/HistoricBetView.swift +++ b/Sources/AllInApp/AllIn/Views/HistoricBetView.swift @@ -1,18 +1,37 @@ // -// HistoricBetView.swift +// BetView.swift // AllIn // -// Created by Lucas Delanier on 10/01/2024. +// 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 { - Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) + + 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() + ReviewCard() + } + .padding([.trailing, .leading, .bottom],25) + } + Spacer() + } + .edgesIgnoringSafeArea(.bottom) + .background(AllInColors.backgroundColor) } } -#Preview { - HistoricBetView() -} diff --git a/Sources/AllInApp/AllIn/Views/MainView.swift b/Sources/AllInApp/AllIn/Views/MainView.swift index c7c2dd1..790873f 100644 --- a/Sources/AllInApp/AllIn/Views/MainView.swift +++ b/Sources/AllInApp/AllIn/Views/MainView.swift @@ -37,16 +37,14 @@ struct MainView: View { switch page { case "Bet": BetView(showMenu: self.$showMenu) - + case "Historic": + HistoricBetView(showMenu: self.$showMenu) case "Ranking": RankingView(showMenu: self.$showMenu) - case "Friends": FriendsView(showMenu: self.$showMenu) - case "CreationBet": CreationBetView(showMenu: self.$showMenu) - default: BetView(showMenu: self.$showMenu) } diff --git a/Sources/AllInApp/AllInApp.xcodeproj/project.pbxproj b/Sources/AllInApp/AllInApp.xcodeproj/project.pbxproj index 2e1fc6d..bde5765 100644 --- a/Sources/AllInApp/AllInApp.xcodeproj/project.pbxproj +++ b/Sources/AllInApp/AllInApp.xcodeproj/project.pbxproj @@ -7,6 +7,8 @@ objects = { /* Begin PBXBuildFile section */ + 1244EF602B4EC31E00374ABF /* HistoricBetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1244EF5F2B4EC31E00374ABF /* HistoricBetView.swift */; }; + 1244EF622B4EC67000374ABF /* ReviewCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1244EF612B4EC67000374ABF /* ReviewCard.swift */; }; EC0193782B25BF16005D81E6 /* AllcoinsCapsule.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC0193772B25BF16005D81E6 /* AllcoinsCapsule.swift */; }; EC01937A2B25C12B005D81E6 /* BetCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC0193792B25C12B005D81E6 /* BetCard.swift */; }; EC01937C2B25C2A8005D81E6 /* AllcoinsCounter.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC01937B2B25C2A8005D81E6 /* AllcoinsCounter.swift */; }; @@ -97,6 +99,8 @@ 122278B72B4BDE1100E632AA /* DependencyInjection.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = DependencyInjection.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 122278B92B4BDE9500E632AA /* Package.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = Package.swift; path = ../Model/Package.swift; sourceTree = ""; }; 122278BB2B4BDEC300E632AA /* Sources */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Sources; path = ../StubLib/Sources; sourceTree = ""; }; + 1244EF5F2B4EC31E00374ABF /* HistoricBetView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HistoricBetView.swift; sourceTree = ""; }; + 1244EF612B4EC67000374ABF /* ReviewCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReviewCard.swift; sourceTree = ""; }; EC0193772B25BF16005D81E6 /* AllcoinsCapsule.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AllcoinsCapsule.swift; sourceTree = ""; }; EC0193792B25C12B005D81E6 /* BetCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BetCard.swift; sourceTree = ""; }; EC01937B2B25C2A8005D81E6 /* AllcoinsCounter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AllcoinsCounter.swift; sourceTree = ""; }; @@ -285,6 +289,7 @@ EC650A4B2B25E9C7003AFCAD /* RankingView.swift */, EC650A512B2794DD003AFCAD /* BetView.swift */, EC7A882C2B28D8A1004F226A /* CreationBetView.swift */, + 1244EF5F2B4EC31E00374ABF /* HistoricBetView.swift */, ); path = Views; sourceTree = ""; @@ -310,6 +315,7 @@ EC7A882E2B28E6BE004F226A /* ConfidentialityButton.swift */, ECA9D1C82B2D9ADA0076E0EC /* UserInfo.swift */, ECA9D1CA2B2DA2320076E0EC /* DropDownFriends.swift */, + 1244EF612B4EC67000374ABF /* ReviewCard.swift */, ); path = Components; sourceTree = ""; @@ -502,6 +508,7 @@ EC7A882B2B28D1E0004F226A /* DropDownMenu.swift in Sources */, EC7A882D2B28D8A1004F226A /* CreationBetView.swift in Sources */, EC6B96CF2B24B8D900FC1C58 /* Config.swift in Sources */, + 1244EF602B4EC31E00374ABF /* HistoricBetView.swift in Sources */, EC30770B2B24D9160060E34D /* WelcomeView.swift in Sources */, EC30770D2B24DB7A0060E34D /* Extensions.swift in Sources */, EC6B96D82B24BF2100FC1C58 /* Menu.swift in Sources */, @@ -513,6 +520,7 @@ ECA9D1CB2B2DA2320076E0EC /* DropDownFriends.swift in Sources */, ECB26A1B2B40746C00FE06B3 /* FriendsViewModel.swift in Sources */, ECB7BC682B2F1ADF002A6654 /* LoginViewModel.swift in Sources */, + 1244EF622B4EC67000374ABF /* ReviewCard.swift in Sources */, EC6B96D52B24BE0E00FC1C58 /* MainView.swift in Sources */, EC650A562B279D68003AFCAD /* WinModal.swift in Sources */, EC6B96D12B24BAE800FC1C58 /* AuthService.swift in Sources */,