diff --git a/nirvana-ios.xcodeproj/project.pbxproj b/nirvana-ios.xcodeproj/project.pbxproj index ef824bb..462b74e 100644 --- a/nirvana-ios.xcodeproj/project.pbxproj +++ b/nirvana-ios.xcodeproj/project.pbxproj @@ -158,14 +158,13 @@ 891A15F62765639B00B26659 /* Views */ = { isa = PBXGroup; children = ( + 89BCABEE276D2DD6009E9B10 /* PhoneVerification */, 89BDCDED2769B3EB00577829 /* Contacts */, 89F1386B2767EB07006680ED /* SignIn */, 892179E22765FE93001E6C60 /* FooterControlsView */, 891A16052765726800B26659 /* Templates */, 891A16042765725D00B26659 /* WelcomeView */, 891A1608276572BB00B26659 /* HomeView */, - 89BCABEA276D2A07009E9B10 /* PhoneVerificationView.swift */, - 89BCABEC276D2B05009E9B10 /* WavesGlassBackgroundView.swift */, ); path = Views; sourceTree = ""; @@ -184,6 +183,7 @@ children = ( 891A15FE27656F9200B26659 /* HeaderView.swift */, 89288ECA27675B9F00E962C4 /* OnboardingTemplateView.swift */, + 89BCABEC276D2B05009E9B10 /* WavesGlassBackgroundView.swift */, ); path = Templates; sourceTree = ""; @@ -248,6 +248,14 @@ path = InnerCircle; sourceTree = ""; }; + 89BCABEE276D2DD6009E9B10 /* PhoneVerification */ = { + isa = PBXGroup; + children = ( + 89BCABEA276D2A07009E9B10 /* PhoneVerificationView.swift */, + ); + path = PhoneVerification; + sourceTree = ""; + }; 89BDCDE827697F6100577829 /* UserMenu */ = { isa = PBXGroup; children = ( diff --git a/nirvana-ios/Assets.xcassets/illustrations/undraw_my_password_d-6-kg.imageset/Contents.json b/nirvana-ios/Assets.xcassets/illustrations/undraw_my_password_d-6-kg.imageset/Contents.json new file mode 100644 index 0000000..9710515 --- /dev/null +++ b/nirvana-ios/Assets.xcassets/illustrations/undraw_my_password_d-6-kg.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "undraw_my_password_d-6-kg.svg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/nirvana-ios/Assets.xcassets/illustrations/undraw_my_password_d-6-kg.imageset/undraw_my_password_d-6-kg.svg b/nirvana-ios/Assets.xcassets/illustrations/undraw_my_password_d-6-kg.imageset/undraw_my_password_d-6-kg.svg new file mode 100644 index 0000000..5785572 --- /dev/null +++ b/nirvana-ios/Assets.xcassets/illustrations/undraw_my_password_d-6-kg.imageset/undraw_my_password_d-6-kg.svg @@ -0,0 +1 @@ +my password \ No newline at end of file diff --git a/nirvana-ios/ContentView.swift b/nirvana-ios/ContentView.swift index ae6bbb2..506f11b 100644 --- a/nirvana-ios/ContentView.swift +++ b/nirvana-ios/ContentView.swift @@ -6,19 +6,20 @@ // import SwiftUI +import NavigationStack struct ContentView: View { @EnvironmentObject var authSessionStore: AuthSessionStore var body: some View { - ZStack { + NavigationStackView { switch self.authSessionStore.sessionState { case SessionState.isAuthenticated: HomeView() case SessionState.isLoggedOut: WelcomeView() } - }.animation(.default, value:authSessionStore.sessionState) + } } } diff --git a/nirvana-ios/Views/HomeView/InnerCircle/InnerCircleView.swift b/nirvana-ios/Views/HomeView/InnerCircle/InnerCircleView.swift index b17576d..5808d08 100644 --- a/nirvana-ios/Views/HomeView/InnerCircle/InnerCircleView.swift +++ b/nirvana-ios/Views/HomeView/InnerCircle/InnerCircleView.swift @@ -10,9 +10,6 @@ import SwiftUI struct InnerCircleView: View { let universalSize = UIScreen.main.bounds - - - // TESTING // users who will have a thumping thing because they sent a message @State var usersWithNewMessage: [Int] = [] diff --git a/nirvana-ios/Views/PhoneVerification/PhoneVerificationView.swift b/nirvana-ios/Views/PhoneVerification/PhoneVerificationView.swift new file mode 100644 index 0000000..7953d3f --- /dev/null +++ b/nirvana-ios/Views/PhoneVerification/PhoneVerificationView.swift @@ -0,0 +1,60 @@ +// +// PhoneVerificationView.swift +// nirvana-ios +// +// Created by Arjun Patel on 12/17/21. +// + +import SwiftUI + + +// user can type in a phone number and then receive a text +struct PhoneVerificationView: View { + @State var phoneNumber = "" + + + var body: some View { + ZStack { + 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) + + Button { + print("send verification") + + + } label: { + Text("send verification") + .bold() + .foregroundColor(NirvanaColor.white) + .frame(maxWidth: .infinity) + .padding(.vertical, 20) + .background(NirvanaColor.teal) + .clipShape(Capsule()) + .shadow(radius:10) + } + } + )) + } + } +} + +struct PhoneVerificationView_Previews: PreviewProvider { + static var previews: some View { + PhoneVerificationView().environmentObject(AuthSessionStore()) + } +} + +// another view for user to type in the sms code +struct PhoneVerificationCodeView: View { + var body: some View { + Text("Verification View") + } +} + +struct PhoneVerificationCodeView_Previews: PreviewProvider { + static var previews: some View { + PhoneVerificationCodeView() + } +} diff --git a/nirvana-ios/Views/PhoneVerificationView.swift b/nirvana-ios/Views/PhoneVerificationView.swift deleted file mode 100644 index 30be890..0000000 --- a/nirvana-ios/Views/PhoneVerificationView.swift +++ /dev/null @@ -1,35 +0,0 @@ -// -// PhoneVerificationView.swift -// nirvana-ios -// -// Created by Arjun Patel on 12/17/21. -// - -import SwiftUI - - -// user can type in a phone number and then receive a text -struct PhoneVerificationView: View { - var body: some View { - Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) - } -} - -struct PhoneVerificationView_Previews: PreviewProvider { - static var previews: some View { - PhoneVerificationView() - } -} - -// another view for user to type in the sms code -struct PhoneVerificationCodeView: View { - var body: some View { - Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) - } -} - -struct PhoneVerificationCodeView_Previews: PreviewProvider { - static var previews: some View { - PhoneVerificationCodeView() - } -} diff --git a/nirvana-ios/Views/Templates/OnboardingTemplateView.swift b/nirvana-ios/Views/Templates/OnboardingTemplateView.swift index b010c6a..6b1384a 100644 --- a/nirvana-ios/Views/Templates/OnboardingTemplateView.swift +++ b/nirvana-ios/Views/Templates/OnboardingTemplateView.swift @@ -38,28 +38,31 @@ struct OnboardingTemplateView: View { self.bottomActionArea = bottomActArea } - var body: some View { - VStack(spacing: 0) { - HeaderView() + var body: some View { + ZStack { + WavesGlassBackgroundView() - VStack { - self.onboardingHeaderText + VStack(spacing: 0) { + HeaderView() - self.onboardingImageView - - self.onboardingActionTextView - - Spacer() - - self.bottomActionArea - } - .padding(.horizontal, screenWidth * 0.05) + VStack { + self.onboardingHeaderText + + self.onboardingImageView + + self.onboardingActionTextView + + Spacer() + + self.bottomActionArea + } + .padding(.horizontal, screenWidth * 0.05) - Spacer() - } //outermost vstack - .accentColor(NirvanaColor.teal) - .background(NirvanaColor.bgLightGrey) - .navigationBarHidden(true) + Spacer() + } //outermost vstack + .accentColor(NirvanaColor.teal) + .navigationBarHidden(true) + } } private var onboardingHeaderText: some View { @@ -139,6 +142,6 @@ struct OnboardingTemplateView_Previews: PreviewProvider { } .padding(.top, 20) ) - ) + ).environmentObject(AuthSessionStore()) } } diff --git a/nirvana-ios/Views/WavesGlassBackgroundView.swift b/nirvana-ios/Views/Templates/WavesGlassBackgroundView.swift similarity index 94% rename from nirvana-ios/Views/WavesGlassBackgroundView.swift rename to nirvana-ios/Views/Templates/WavesGlassBackgroundView.swift index 1cb6b7d..e506fc0 100644 --- a/nirvana-ios/Views/WavesGlassBackgroundView.swift +++ b/nirvana-ios/Views/Templates/WavesGlassBackgroundView.swift @@ -18,8 +18,8 @@ struct WavesGlassBackgroundView: View { ZStack { AngularGradient( gradient: Gradient( - colors: [NirvanaColor.solidBlue, NirvanaColor.dimTeal, Color.orange, NirvanaColor.solidBlue]), - center: .center, + colors: [NirvanaColor.solidBlue, NirvanaColor.dimTeal, Color.orange.opacity(0.4), NirvanaColor.teal.opacity(0.5), NirvanaColor.teal.opacity(0.3), NirvanaColor.solidTeal.opacity(0.3), NirvanaColor.solidBlue]), + center: .bottom, angle: .degrees(120)) LinearGradient(gradient: Gradient( diff --git a/nirvana-ios/Views/WelcomeView/WelcomeView.swift b/nirvana-ios/Views/WelcomeView/WelcomeView.swift index 1aff8c3..300fd12 100644 --- a/nirvana-ios/Views/WelcomeView/WelcomeView.swift +++ b/nirvana-ios/Views/WelcomeView/WelcomeView.swift @@ -11,30 +11,31 @@ struct WelcomeView: View { @State var showLearnMore = false var body: some View { - NavigationView { - 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) { - NavigationLink(destination: OnboardingTrioView()) { - Text("Start Your Detox") - .bold() - .foregroundColor(NirvanaColor.white) - .frame(maxWidth: .infinity) - .padding(.vertical, 20) - .background(NirvanaColor.teal) - .clipShape(Capsule()) - .shadow(radius:10) - } - - Link("Learn More", destination: URL(string: NirvanaConstants.landingPageUrl)!) - .font(.caption) - .foregroundColor(NirvanaColor.teal) - - //learn more button to usenirvana.com + 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") + } label: { + Text("Start Your Detox") + .bold() + .foregroundColor(NirvanaColor.white) + .frame(maxWidth: .infinity) + .padding(.vertical, 20) + .background(NirvanaColor.teal) + .clipShape(Capsule()) + .shadow(radius:10) } - .padding(.top, 20) - ) - ).navigationBarHidden(true) - }.navigationBarHidden(true) // navigation view + + + Link("Learn More", destination: URL(string: NirvanaConstants.landingPageUrl)!) + .font(.caption) + .foregroundColor(NirvanaColor.white) + + //learn more button to usenirvana.com + } + .padding(.top, 20) + ) + ) } // View body } // View