diff --git a/Sources/allin/allin.xcodeproj/project.pbxproj b/Sources/allin/allin.xcodeproj/project.pbxproj index c983f53..4dfbea3 100644 --- a/Sources/allin/allin.xcodeproj/project.pbxproj +++ b/Sources/allin/allin.xcodeproj/project.pbxproj @@ -25,6 +25,7 @@ EC87FCDB2ABBA6AC00363986 /* TrendingBetCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC87FCDA2ABBA6AC00363986 /* TrendingBetCard.swift */; }; EC9A45B02ABDF4A800125D41 /* HomeScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC9A45AF2ABDF4A800125D41 /* HomeScreen.swift */; }; ECDF624A2AC1CAFD00BA8213 /* RegisterScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECDF62492AC1CAFD00BA8213 /* RegisterScreen.swift */; }; + ECDF624C2AC205E100BA8213 /* BetScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECDF624B2AC205E100BA8213 /* BetScreen.swift */; }; ECFC54442AC0C39E00195760 /* LoginScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECFC54432AC0C39E00195760 /* LoginScreen.swift */; }; /* End PBXBuildFile section */ @@ -68,6 +69,7 @@ EC87FCDA2ABBA6AC00363986 /* TrendingBetCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TrendingBetCard.swift; path = allin/Views/TrendingBetCard.swift; sourceTree = SOURCE_ROOT; }; EC9A45AF2ABDF4A800125D41 /* HomeScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = HomeScreen.swift; path = allin/Screens/HomeScreen.swift; sourceTree = SOURCE_ROOT; }; ECDF62492AC1CAFD00BA8213 /* RegisterScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = RegisterScreen.swift; path = allin/Screens/RegisterScreen.swift; sourceTree = SOURCE_ROOT; }; + ECDF624B2AC205E100BA8213 /* BetScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = BetScreen.swift; path = allin/Screens/BetScreen.swift; sourceTree = SOURCE_ROOT; }; ECFC54432AC0C39E00195760 /* LoginScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = LoginScreen.swift; path = allin/Screens/LoginScreen.swift; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ @@ -193,6 +195,7 @@ EC50BF972ABF541B00197685 /* WelcomeScreen.swift */, ECFC54432AC0C39E00195760 /* LoginScreen.swift */, ECDF62492AC1CAFD00BA8213 /* RegisterScreen.swift */, + ECDF624B2AC205E100BA8213 /* BetScreen.swift */, ); path = Screens; sourceTree = ""; @@ -340,6 +343,7 @@ EC46D7DD2ABCCC270030AC04 /* MenuView.swift in Sources */, EC87FCD92ABBA60900363986 /* Colors.swift in Sources */, D98C4D662AB9D017007A6B4D /* ContentView.swift in Sources */, + ECDF624C2AC205E100BA8213 /* BetScreen.swift in Sources */, D92EC57C2ABADA2800CCD30E /* CoinCounterView.swift in Sources */, D98C4D8E2AB9D440007A6B4D /* TopBarView.swift in Sources */, EC50BF962ABF4D3300197685 /* SplashScreen.swift in Sources */, diff --git a/Sources/allin/allin/ContentView.swift b/Sources/allin/allin/ContentView.swift index 055470a..f5b2673 100644 --- a/Sources/allin/allin/ContentView.swift +++ b/Sources/allin/allin/ContentView.swift @@ -9,41 +9,9 @@ import SwiftUI struct ContentView: View { - @State var showMenu = false - var body: some View { - - let closeDrag = DragGesture() - .onEnded { - if $0.translation.width < -100 { - withAnimation{ - self.showMenu = false - } - } - } - let openDrag = DragGesture() - .onEnded { - if $0.translation.width > 100 { - withAnimation{ - self.showMenu = true - } - } - } - - GeometryReader { geometry in - ZStack(alignment: .leading) { - Home(showMenu: self.$showMenu) - .frame(width: geometry.size.width, height: geometry.size.height) - .offset(x: self.showMenu ? geometry.size.width/1.21:0) - .gesture(openDrag) - - if self.showMenu { - MenuView() - .frame(width: geometry.size.width*0.83) - .transition(.move(edge: .leading)) - } - } - .gesture(closeDrag) + NavigationView { + Welcome() } } } diff --git a/Sources/allin/allin/Screens/LoginScreen.swift b/Sources/allin/allin/Screens/LoginScreen.swift index dd1f28c..de07e4d 100644 --- a/Sources/allin/allin/Screens/LoginScreen.swift +++ b/Sources/allin/allin/Screens/LoginScreen.swift @@ -42,49 +42,53 @@ struct Login: View { TextField("", text: $password, prompt: Text("Mot de passe").foregroundColor(.gray)) } } - .padding() - .background(Color.white.cornerRadius(9)) - .frame(width: 300) - .overlay( - RoundedRectangle(cornerRadius: 9, style: .continuous) - .stroke(AllinColor.StrokeGrayColor, lineWidth: 1) - ) - .overlay( - HStack { - Spacer() - Button(action: { - isPasswordVisible.toggle() - }) { - Image(systemName: isPasswordVisible ? "eye.slash" : "eye") - .foregroundColor(.gray) - } - .padding(.trailing, 8) + .padding() + .background(Color.white.cornerRadius(9)) + .frame(width: 300) + .overlay( + RoundedRectangle(cornerRadius: 9, style: .continuous) + .stroke(AllinColor.StrokeGrayColor, lineWidth: 1) + ) + .overlay( + HStack { + Spacer() + Button(action: { + isPasswordVisible.toggle() + }) { + Image(systemName: isPasswordVisible ? "eye.slash" : "eye") + .foregroundColor(.gray) } - ) - .foregroundColor(.black) + .padding(.trailing, 8) + } + ) + .foregroundColor(.black) Text("Mot de passe oublié?") .frame(alignment: .trailing) .padding(.bottom, 20) .padding(.leading, 150) .betTextStyle(weight: .medium, color: AllinColor.StartTextColor, size: 14) - - Button(action: {}) { + + NavigationLink(destination: Home(page: "Bet").navigationBarBackButtonHidden(true)) + { Text("Se connecter") .betTextStyle(weight: .bold, color: .white, size: 17) + .frame(width: 300, height: 60) + .background(LinearGradient(gradient: + Gradient(colors:[AllinColor.TopBarColorPink,AllinColor.TopBarColorPurple,AllinColor.TopBarColorBlue]), + startPoint: .leading, endPoint: .trailing)) + .cornerRadius(13) } - .frame(width: 300, height: 60) - .background(LinearGradient(gradient: - Gradient(colors:[AllinColor.TopBarColorPink,AllinColor.TopBarColorPurple,AllinColor.TopBarColorBlue]), - startPoint: .leading, endPoint: .trailing)) - .cornerRadius(13) Spacer() HStack(spacing: 0) { Text("Pas encore inscrit? ") .betTextStyle(weight: .regular, color: AllinColor.StartTextColor, size: 16) - Text("S'inscrire") - .betTextStyle(weight: .semibold, color: AllinColor.PurpleText, size: 16) + NavigationLink(destination: Register().navigationBarBackButtonHidden(true)) + { + Text("S'inscrire") + .betTextStyle(weight: .semibold, color: AllinColor.PurpleText, size: 16) + } } } diff --git a/Sources/allin/allin/Screens/RegisterScreen.swift b/Sources/allin/allin/Screens/RegisterScreen.swift index be0f149..ef88316 100644 --- a/Sources/allin/allin/Screens/RegisterScreen.swift +++ b/Sources/allin/allin/Screens/RegisterScreen.swift @@ -23,7 +23,6 @@ struct Register: View { if (pseudo != "") { Text("Bonjour "+pseudo+",") .betTextStyle(weight: .semibold, color: AllinColor.StartTextColor, size: 40) - .lineLimit(1) .padding([.trailing, .leading], 30) } else { Text("Bonjour,") @@ -116,7 +115,6 @@ struct Register: View { Image(systemName: isPasswordVisible ? "eye.slash" : "eye") .foregroundColor(.gray) } - .padding(.bottom, 8) .padding(.trailing, 8) } ) @@ -138,8 +136,11 @@ struct Register: View { HStack(spacing: 0) { Text("Tu as déjà un compte? ") .betTextStyle(weight: .regular, color: AllinColor.StartTextColor, size: 16) - Text("Se connecter") - .betTextStyle(weight: .semibold, color: AllinColor.PurpleText, size: 16) + NavigationLink(destination: Login().navigationBarBackButtonHidden(true)) + { + Text("Se connecter") + .betTextStyle(weight: .semibold, color: AllinColor.PurpleText, size: 16) + } } } diff --git a/Sources/allin/allin/Screens/WelcomeScreen.swift b/Sources/allin/allin/Screens/WelcomeScreen.swift index 54c7fcb..2ad67fa 100644 --- a/Sources/allin/allin/Screens/WelcomeScreen.swift +++ b/Sources/allin/allin/Screens/WelcomeScreen.swift @@ -61,19 +61,24 @@ struct Welcome: View { .padding([.leading,.trailing], 40) Spacer() Spacer() - Button(action: {}) { + NavigationLink(destination: Register().navigationBarBackButtonHidden(true)) + { Text("Rejoindre") .betTextStyle(weight: .bold, color: AllinColor.StartBackground, size: 17) + .frame(width: geometry.size.width*0.85, height: 50) + .background(AllinColor.LightPurple) + .cornerRadius(30) } - .frame(width: geometry.size.width*0.85, height: 50) - .background(AllinColor.LightPurple) - .cornerRadius(30) + HStack(spacing: 0) { Text("Tu as déja un compte? ") .betTextStyle(weight: .regular, color: AllinColor.LightPurple, size: 16) - Text("Connexion") - .betTextStyle(weight: .semibold, color: AllinColor.LightPurple, size: 16) - .underline() + NavigationLink(destination: Login().navigationBarBackButtonHidden(true)) + { + Text("Connexion") + .betTextStyle(weight: .semibold, color: AllinColor.LightPurple, size: 16) + .underline() + } } Spacer() } diff --git a/Sources/allin/allin/Views/MenuView.swift b/Sources/allin/allin/Views/MenuView.swift index 3273aaa..fb4e1e0 100644 --- a/Sources/allin/allin/Views/MenuView.swift +++ b/Sources/allin/allin/Views/MenuView.swift @@ -12,8 +12,11 @@ struct MenuView: View { var body: some View { VStack(alignment: .leading, spacing: 10) { - ParameterMenuView(icon: "VideoGame", title: "CREER UN BET", description: "Créez un nouveau BET et faites participer vos amis.") - .padding([.leading,.trailing], 13) + NavigationLink(destination: Home(page: "CreationBet").navigationBarBackButtonHidden(true)) + { + ParameterMenuView(icon: "VideoGame", title: "CREER UN BET", description: "Créez un nouveau BET et faites participer vos amis.") + .padding([.leading,.trailing], 13) + } ParameterMenuView(icon: "Eyes", title: "HISTORIQUE DES BETS", description: "Consultez vos paris en cours et terminés.") .padding([.leading,.trailing], 13)