basic phone input page but not workking with nav

This commit is contained in:
talksik
2021-12-17 15:03:23 -08:00
parent 3639819d04
commit 5dbf79d288
3 changed files with 31 additions and 7 deletions
@@ -6,26 +6,34 @@
//
import SwiftUI
import NavigationStack
// user can type in a phone number and then receive a text
struct PhoneVerificationView: View {
@State var phoneNumber = ""
@EnvironmentObject private var navigationStack: NavigationStack
var body: some View {
ZStack {
ZStack(alignment: .topLeading) {
Color.clear
OnboardingTemplateView(hdrText: "Let's get you verified", imgName: "undraw_my_password_d-6-kg", bottomActArea: AnyView(
VStack {
TextField("enter phone number", text: $phoneNumber)
.background(Color.white)
HStack {
TextField("enter phone number", text: $phoneNumber)
.background(Color.white.opacity(0.5))
TextField("enter phone number", text: $phoneNumber)
.background(Color.white.opacity(0.5))
}
.padding(.vertical, 20)
Button {
print("send verification")
self.navigationStack.pop() // goes back to welcome screen
} label: {
Text("send verification")
Text("Send Verification")
.bold()
.foregroundColor(NirvanaColor.white)
.frame(maxWidth: .infinity)
@@ -36,6 +44,17 @@ struct PhoneVerificationView: View {
}
}
))
//back button to home
Button {
print("going back to last page")
} label: {
Label("Back", systemImage: "chevron.left")
.labelStyle(.iconOnly)
.foregroundColor(NirvanaColor.teal)
.padding()
}
}
}
}
@@ -40,6 +40,7 @@ struct OnboardingTemplateView: View {
var body: some View {
ZStack {
// TODO: CAREFUL...this needs to be on top if any view is using this subview...otherwise elements will be dimmed and placed beneath this background
WavesGlassBackgroundView()
VStack(spacing: 0) {
@@ -6,15 +6,19 @@
//
import SwiftUI
import NavigationStack
struct WelcomeView: View {
@State var showLearnMore = false
@EnvironmentObject private var navigationStack: NavigationStack
var body: some View {
OnboardingTemplateView(imgName: "undraw_friendship_mni7", mainLeadingActText: "Your", mainHighlightedActText: "minimalist", mainTrailingActText: "social media.", subActText: "Tired of the rat race on insta, snap, tik-tok, \"meta\"?", bottomActArea: AnyView(
VStack(alignment: .center) {
Button {
print("going to the sign in page")
self.navigationStack.push(PhoneVerificationView())
} label: {
Text("Start Your Detox")
.bold()