Add Navigation

pull/2/head
Emre KARTAL 2 years ago
parent 40a2ab261c
commit 738e77ad9f

@ -25,6 +25,7 @@
EC87FCDB2ABBA6AC00363986 /* TrendingBetCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC87FCDA2ABBA6AC00363986 /* TrendingBetCard.swift */; }; EC87FCDB2ABBA6AC00363986 /* TrendingBetCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC87FCDA2ABBA6AC00363986 /* TrendingBetCard.swift */; };
EC9A45B02ABDF4A800125D41 /* HomeScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC9A45AF2ABDF4A800125D41 /* HomeScreen.swift */; }; EC9A45B02ABDF4A800125D41 /* HomeScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC9A45AF2ABDF4A800125D41 /* HomeScreen.swift */; };
ECDF624A2AC1CAFD00BA8213 /* RegisterScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECDF62492AC1CAFD00BA8213 /* RegisterScreen.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 */; }; ECFC54442AC0C39E00195760 /* LoginScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECFC54432AC0C39E00195760 /* LoginScreen.swift */; };
/* End PBXBuildFile section */ /* 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; }; 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; }; 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; }; 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; }; ECFC54432AC0C39E00195760 /* LoginScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = LoginScreen.swift; path = allin/Screens/LoginScreen.swift; sourceTree = SOURCE_ROOT; };
/* End PBXFileReference section */ /* End PBXFileReference section */
@ -193,6 +195,7 @@
EC50BF972ABF541B00197685 /* WelcomeScreen.swift */, EC50BF972ABF541B00197685 /* WelcomeScreen.swift */,
ECFC54432AC0C39E00195760 /* LoginScreen.swift */, ECFC54432AC0C39E00195760 /* LoginScreen.swift */,
ECDF62492AC1CAFD00BA8213 /* RegisterScreen.swift */, ECDF62492AC1CAFD00BA8213 /* RegisterScreen.swift */,
ECDF624B2AC205E100BA8213 /* BetScreen.swift */,
); );
path = Screens; path = Screens;
sourceTree = "<group>"; sourceTree = "<group>";
@ -340,6 +343,7 @@
EC46D7DD2ABCCC270030AC04 /* MenuView.swift in Sources */, EC46D7DD2ABCCC270030AC04 /* MenuView.swift in Sources */,
EC87FCD92ABBA60900363986 /* Colors.swift in Sources */, EC87FCD92ABBA60900363986 /* Colors.swift in Sources */,
D98C4D662AB9D017007A6B4D /* ContentView.swift in Sources */, D98C4D662AB9D017007A6B4D /* ContentView.swift in Sources */,
ECDF624C2AC205E100BA8213 /* BetScreen.swift in Sources */,
D92EC57C2ABADA2800CCD30E /* CoinCounterView.swift in Sources */, D92EC57C2ABADA2800CCD30E /* CoinCounterView.swift in Sources */,
D98C4D8E2AB9D440007A6B4D /* TopBarView.swift in Sources */, D98C4D8E2AB9D440007A6B4D /* TopBarView.swift in Sources */,
EC50BF962ABF4D3300197685 /* SplashScreen.swift in Sources */, EC50BF962ABF4D3300197685 /* SplashScreen.swift in Sources */,

@ -9,41 +9,9 @@ import SwiftUI
struct ContentView: View { struct ContentView: View {
@State var showMenu = false
var body: some View { var body: some View {
NavigationView {
let closeDrag = DragGesture() Welcome()
.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)
} }
} }
} }

@ -42,49 +42,53 @@ struct Login: View {
TextField("", text: $password, prompt: Text("Mot de passe").foregroundColor(.gray)) TextField("", text: $password, prompt: Text("Mot de passe").foregroundColor(.gray))
} }
} }
.padding() .padding()
.background(Color.white.cornerRadius(9)) .background(Color.white.cornerRadius(9))
.frame(width: 300) .frame(width: 300)
.overlay( .overlay(
RoundedRectangle(cornerRadius: 9, style: .continuous) RoundedRectangle(cornerRadius: 9, style: .continuous)
.stroke(AllinColor.StrokeGrayColor, lineWidth: 1) .stroke(AllinColor.StrokeGrayColor, lineWidth: 1)
) )
.overlay( .overlay(
HStack { HStack {
Spacer() Spacer()
Button(action: { Button(action: {
isPasswordVisible.toggle() isPasswordVisible.toggle()
}) { }) {
Image(systemName: isPasswordVisible ? "eye.slash" : "eye") Image(systemName: isPasswordVisible ? "eye.slash" : "eye")
.foregroundColor(.gray) .foregroundColor(.gray)
}
.padding(.trailing, 8)
} }
) .padding(.trailing, 8)
.foregroundColor(.black) }
)
.foregroundColor(.black)
Text("Mot de passe oublié?") Text("Mot de passe oublié?")
.frame(alignment: .trailing) .frame(alignment: .trailing)
.padding(.bottom, 20) .padding(.bottom, 20)
.padding(.leading, 150) .padding(.leading, 150)
.betTextStyle(weight: .medium, color: AllinColor.StartTextColor, size: 14) .betTextStyle(weight: .medium, color: AllinColor.StartTextColor, size: 14)
Button(action: {}) { NavigationLink(destination: Home(page: "Bet").navigationBarBackButtonHidden(true))
{
Text("Se connecter") Text("Se connecter")
.betTextStyle(weight: .bold, color: .white, size: 17) .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() Spacer()
HStack(spacing: 0) { HStack(spacing: 0) {
Text("Pas encore inscrit? ") Text("Pas encore inscrit? ")
.betTextStyle(weight: .regular, color: AllinColor.StartTextColor, size: 16) .betTextStyle(weight: .regular, color: AllinColor.StartTextColor, size: 16)
Text("S'inscrire") NavigationLink(destination: Register().navigationBarBackButtonHidden(true))
.betTextStyle(weight: .semibold, color: AllinColor.PurpleText, size: 16) {
Text("S'inscrire")
.betTextStyle(weight: .semibold, color: AllinColor.PurpleText, size: 16)
}
} }
} }

@ -23,7 +23,6 @@ struct Register: View {
if (pseudo != "") { if (pseudo != "") {
Text("Bonjour "+pseudo+",") Text("Bonjour "+pseudo+",")
.betTextStyle(weight: .semibold, color: AllinColor.StartTextColor, size: 40) .betTextStyle(weight: .semibold, color: AllinColor.StartTextColor, size: 40)
.lineLimit(1)
.padding([.trailing, .leading], 30) .padding([.trailing, .leading], 30)
} else { } else {
Text("Bonjour,") Text("Bonjour,")
@ -116,7 +115,6 @@ struct Register: View {
Image(systemName: isPasswordVisible ? "eye.slash" : "eye") Image(systemName: isPasswordVisible ? "eye.slash" : "eye")
.foregroundColor(.gray) .foregroundColor(.gray)
} }
.padding(.bottom, 8)
.padding(.trailing, 8) .padding(.trailing, 8)
} }
) )
@ -138,8 +136,11 @@ struct Register: View {
HStack(spacing: 0) { HStack(spacing: 0) {
Text("Tu as déjà un compte? ") Text("Tu as déjà un compte? ")
.betTextStyle(weight: .regular, color: AllinColor.StartTextColor, size: 16) .betTextStyle(weight: .regular, color: AllinColor.StartTextColor, size: 16)
Text("Se connecter") NavigationLink(destination: Login().navigationBarBackButtonHidden(true))
.betTextStyle(weight: .semibold, color: AllinColor.PurpleText, size: 16) {
Text("Se connecter")
.betTextStyle(weight: .semibold, color: AllinColor.PurpleText, size: 16)
}
} }
} }

@ -61,19 +61,24 @@ struct Welcome: View {
.padding([.leading,.trailing], 40) .padding([.leading,.trailing], 40)
Spacer() Spacer()
Spacer() Spacer()
Button(action: {}) { NavigationLink(destination: Register().navigationBarBackButtonHidden(true))
{
Text("Rejoindre") Text("Rejoindre")
.betTextStyle(weight: .bold, color: AllinColor.StartBackground, size: 17) .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) { HStack(spacing: 0) {
Text("Tu as déja un compte? ") Text("Tu as déja un compte? ")
.betTextStyle(weight: .regular, color: AllinColor.LightPurple, size: 16) .betTextStyle(weight: .regular, color: AllinColor.LightPurple, size: 16)
Text("Connexion") NavigationLink(destination: Login().navigationBarBackButtonHidden(true))
.betTextStyle(weight: .semibold, color: AllinColor.LightPurple, size: 16) {
.underline() Text("Connexion")
.betTextStyle(weight: .semibold, color: AllinColor.LightPurple, size: 16)
.underline()
}
} }
Spacer() Spacer()
} }

@ -12,8 +12,11 @@ struct MenuView: View {
var body: some View { var body: some View {
VStack(alignment: .leading, spacing: 10) { VStack(alignment: .leading, spacing: 10) {
ParameterMenuView(icon: "VideoGame", title: "CREER UN BET", description: "Créez un nouveau BET et faites participer vos amis.") NavigationLink(destination: Home(page: "CreationBet").navigationBarBackButtonHidden(true))
.padding([.leading,.trailing], 13) {
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.") ParameterMenuView(icon: "Eyes", title: "HISTORIQUE DES BETS", description: "Consultez vos paris en cours et terminés.")
.padding([.leading,.trailing], 13) .padding([.leading,.trailing], 13)

Loading…
Cancel
Save