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 */; };
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 = "<group>";
@ -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 */,

@ -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()
}
}
}

@ -69,23 +69,27 @@ struct Login: View {
.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)
}
Spacer()
HStack(spacing: 0) {
Text("Pas encore inscrit? ")
.betTextStyle(weight: .regular, color: AllinColor.StartTextColor, size: 16)
NavigationLink(destination: Register().navigationBarBackButtonHidden(true))
{
Text("S'inscrire")
.betTextStyle(weight: .semibold, color: AllinColor.PurpleText, size: 16)
}
}
}
.frame(width: geometry.size.width, height: geometry.size.height)

@ -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,9 +136,12 @@ struct Register: View {
HStack(spacing: 0) {
Text("Tu as déjà un compte? ")
.betTextStyle(weight: .regular, color: AllinColor.StartTextColor, size: 16)
NavigationLink(destination: Login().navigationBarBackButtonHidden(true))
{
Text("Se connecter")
.betTextStyle(weight: .semibold, color: AllinColor.PurpleText, size: 16)
}
}
}

@ -61,20 +61,25 @@ 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)
}
HStack(spacing: 0) {
Text("Tu as déja un compte? ")
.betTextStyle(weight: .regular, color: AllinColor.LightPurple, size: 16)
NavigationLink(destination: Login().navigationBarBackButtonHidden(true))
{
Text("Connexion")
.betTextStyle(weight: .semibold, color: AllinColor.LightPurple, size: 16)
.underline()
}
}
Spacer()
}
.frame(width: geometry.size.width, height: geometry.size.height/3.5)

@ -12,8 +12,11 @@ struct MenuView: View {
var body: some View {
VStack(alignment: .leading, spacing: 10) {
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)

Loading…
Cancel
Save