bunch of ui adjustments

This commit is contained in:
talksik
2021-12-23 03:48:32 -08:00
parent f6a4d94de4
commit 8f4ecb0780
10 changed files with 402 additions and 264 deletions
+4 -4
View File
@@ -7,7 +7,7 @@
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
8904DEC8277055E90071E6CA /* OnboardingTrioView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8904DEC7277055E90071E6CA /* OnboardingTrioView.swift */; }; 8904DEC8277055E90071E6CA /* OnboardingOneView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8904DEC7277055E90071E6CA /* OnboardingOneView.swift */; };
891060E4277359B900F14509 /* CloudStorageService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 891060E3277359B900F14509 /* CloudStorageService.swift */; }; 891060E4277359B900F14509 /* CloudStorageService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 891060E3277359B900F14509 /* CloudStorageService.swift */; };
891060E82774460500F14509 /* FirebaseInAppMessaging-Beta in Frameworks */ = {isa = PBXBuildFile; productRef = 891060E72774460500F14509 /* FirebaseInAppMessaging-Beta */; }; 891060E82774460500F14509 /* FirebaseInAppMessaging-Beta in Frameworks */ = {isa = PBXBuildFile; productRef = 891060E72774460500F14509 /* FirebaseInAppMessaging-Beta */; };
891060EA2774460500F14509 /* FirebaseInAppMessagingSwift-Beta in Frameworks */ = {isa = PBXBuildFile; productRef = 891060E92774460500F14509 /* FirebaseInAppMessagingSwift-Beta */; }; 891060EA2774460500F14509 /* FirebaseInAppMessagingSwift-Beta in Frameworks */ = {isa = PBXBuildFile; productRef = 891060E92774460500F14509 /* FirebaseInAppMessagingSwift-Beta */; };
@@ -84,7 +84,7 @@
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
8904DEC7277055E90071E6CA /* OnboardingTrioView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OnboardingTrioView.swift; sourceTree = "<group>"; }; 8904DEC7277055E90071E6CA /* OnboardingOneView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OnboardingOneView.swift; sourceTree = "<group>"; };
891060E3277359B900F14509 /* CloudStorageService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CloudStorageService.swift; sourceTree = "<group>"; }; 891060E3277359B900F14509 /* CloudStorageService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CloudStorageService.swift; sourceTree = "<group>"; };
891060E527743FEB00F14509 /* nirvana-ios.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "nirvana-ios.entitlements"; sourceTree = "<group>"; }; 891060E527743FEB00F14509 /* nirvana-ios.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "nirvana-ios.entitlements"; sourceTree = "<group>"; };
89110713277166D6005797FA /* UserFriends.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserFriends.swift; sourceTree = "<group>"; }; 89110713277166D6005797FA /* UserFriends.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserFriends.swift; sourceTree = "<group>"; };
@@ -439,7 +439,7 @@
89F18AF2276ECD5D00115B1E /* OnBoarding */ = { 89F18AF2276ECD5D00115B1E /* OnBoarding */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
8904DEC7277055E90071E6CA /* OnboardingTrioView.swift */, 8904DEC7277055E90071E6CA /* OnboardingOneView.swift */,
); );
path = OnBoarding; path = OnBoarding;
sourceTree = "<group>"; sourceTree = "<group>";
@@ -584,7 +584,7 @@
891A15E127653A7000B26659 /* nirvana_iosApp.swift in Sources */, 891A15E127653A7000B26659 /* nirvana_iosApp.swift in Sources */,
89BCABED276D2B05009E9B10 /* WavesGlassBackgroundView.swift in Sources */, 89BCABED276D2B05009E9B10 /* WavesGlassBackgroundView.swift in Sources */,
89F05BA6276ACD830002E9C7 /* ContactsPickerView.swift in Sources */, 89F05BA6276ACD830002E9C7 /* ContactsPickerView.swift in Sources */,
8904DEC8277055E90071E6CA /* OnboardingTrioView.swift in Sources */, 8904DEC8277055E90071E6CA /* OnboardingOneView.swift in Sources */,
896CE7022770892F00DB474E /* CircleGridView.swift in Sources */, 896CE7022770892F00DB474E /* CircleGridView.swift in Sources */,
89BDCDEA27697F9C00577829 /* UserMenu.swift in Sources */, 89BDCDEA27697F9C00577829 /* UserMenu.swift in Sources */,
89BCABE7276B3D64009E9B10 /* InnerCircleViewModel.swift in Sources */, 89BCABE7276B3D64009E9B10 /* InnerCircleViewModel.swift in Sources */,
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "undraw_explore_re_8l4v.svg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 40 KiB

@@ -9,6 +9,8 @@ import SwiftUI
import NavigationStack import NavigationStack
struct AddBasicInfoView: View { struct AddBasicInfoView: View {
@Environment(\.dismiss) var dismiss
@EnvironmentObject var navigationStack : NavigationStack @EnvironmentObject var navigationStack : NavigationStack
@EnvironmentObject var authSessionStore: AuthSessionStore @EnvironmentObject var authSessionStore: AuthSessionStore
@ObservedObject var addInfoViewModel: AddBasicInfoViewModel = AddBasicInfoViewModel() @ObservedObject var addInfoViewModel: AddBasicInfoViewModel = AddBasicInfoViewModel()
@@ -22,24 +24,11 @@ struct AddBasicInfoView: View {
count: 5) count: 5)
var body: some View { var body: some View {
NavigationView {
ZStack { ZStack {
// bg // bg
WavesGlassBackgroundView() WavesGlassBackgroundView()
// programmatic back button
ZStack(alignment: .topLeading) {
Color.clear
Button {
self.navigationStack.pop()
} label: {
Label("back", systemImage:"chevron.left")
.labelStyle(.iconOnly)
.font(.title2)
}
.padding()
}
// main content // main content
VStack { VStack {
// header logo area // header logo area
@@ -57,7 +46,6 @@ struct AddBasicInfoView: View {
.font(.subheadline) .font(.subheadline)
.foregroundColor(Color.black.opacity(0.7)) .foregroundColor(Color.black.opacity(0.7))
} }
.padding()
// Horizontal scroll view to allow user to select the avatar he or she wants // Horizontal scroll view to allow user to select the avatar he or she wants
ScrollView([.horizontal, .vertical], showsIndicators: false) { ScrollView([.horizontal, .vertical], showsIndicators: false) {
@@ -67,10 +55,10 @@ struct AddBasicInfoView: View {
.resizable() .resizable()
.scaledToFit() .scaledToFit()
.frame(width: 50, height: 50, alignment: .center) .frame(width: 50, height: 50, alignment: .center)
.blur(radius: self.selectedAvatarIndex == index ? 0 : 1) .blur(radius: self.selectedAvatarIndex == index ? 0 : 0.2)
.scaleEffect(self.selectedAvatarIndex == index ? 1.3 : 1) .scaleEffect(self.selectedAvatarIndex == index ? 1.5 : 1)
.padding() .padding()
.background(self.selectedAvatarIndex == index ? Color.white.opacity(0.3) : Color.clear) .background(self.selectedAvatarIndex == index ? NirvanaColor.teal.opacity(0.5) : Color.clear)
.clipShape(Circle()) .clipShape(Circle())
.onTapGesture { .onTapGesture {
print("selected another avatar: \(index)") print("selected another avatar: \(index)")
@@ -84,17 +72,17 @@ struct AddBasicInfoView: View {
// input nickname // input nickname
VStack { VStack {
TextField("Nickname", text: self.$nickname) TextField("nickname", text: self.$nickname)
.padding() .padding()
.background(.ultraThinMaterial) .background(.ultraThinMaterial)
.clipShape(Capsule()) .clipShape(Capsule())
.shadow(color: Color.black.opacity(0.3), radius: 20, x: 0, y: 20) .shadow(radius:10)
.font(.subheadline) .font(.subheadline)
.multilineTextAlignment(.center) .multilineTextAlignment(.center)
Text("What do your friends call you?") Text("What do your friends call you?")
.font(.footnote) .font(.caption)
.foregroundColor(Color.black.opacity(0.7)) .foregroundColor(NirvanaColor.teal)
} }
.padding() .padding()
@@ -118,7 +106,7 @@ struct AddBasicInfoView: View {
} label: { } label: {
Text("Save") Text("Save")
.fontWeight(.heavy) .fontWeight(.heavy)
.foregroundColor(Color.white) .foregroundColor(self.nickname.count == 0 ? Color.white.opacity(0.2) : Color.white)
.frame(maxWidth: .infinity) .frame(maxWidth: .infinity)
.padding(.vertical, 20) .padding(.vertical, 20)
.background(self.nickname.count == 0 ? Color.white.opacity(0.3) : NirvanaColor.teal) .background(self.nickname.count == 0 ? Color.white.opacity(0.3) : NirvanaColor.teal)
@@ -128,7 +116,7 @@ struct AddBasicInfoView: View {
.animation(.default) .animation(.default)
.padding() .padding()
} }
.frame(maxHeight: .infinity) .frame(maxWidth: UIScreen.main.bounds.width - 20, maxHeight: .infinity)
} }
.onAppear { .onAppear {
// get current user nickname and avatar if they have one // get current user nickname and avatar if they have one
@@ -137,6 +125,13 @@ struct AddBasicInfoView: View {
self.selectedAvatarIndex = Avatars.avatarSystemNames.firstIndex(of: (self.authSessionStore.user?.avatar)!) ?? 0 // 0 in case the system names doesn't have it anymore self.selectedAvatarIndex = Avatars.avatarSystemNames.firstIndex(of: (self.authSessionStore.user?.avatar)!) ?? 0 // 0 in case the system names doesn't have it anymore
} }
} }
.navigationBarItems(trailing: Button(action: {
dismiss()
}, label: {
Text("Cancel")
}))
.navigationBarHidden(true)
}
//TODO: hook up the alert with the view model //TODO: hook up the alert with the view model
// .alert(isPresented: Binding<Bool>( // .alert(isPresented: Binding<Bool>(
// get: { self.addInfoViewModel.state == ProfileRegistrationState.failed}, // get: { self.addInfoViewModel.state == ProfileRegistrationState.failed},
@@ -42,7 +42,7 @@ struct CircleNavigationView: View {
} }
Button { Button {
self.navigationStack.push(OnboardingTrioView()) self.navigationStack.push(OnboardingOneView())
} label: { } label: {
Label("why?", systemImage: "leaf") Label("why?", systemImage: "leaf")
.foregroundColor(NirvanaColor.teal) .foregroundColor(NirvanaColor.teal)
@@ -12,6 +12,7 @@ enum SheetView : Identifiable {
var id: Self { self } var id: Self { self }
case contacts case contacts
case inbox case inbox
case profile
} }
struct InnerCircleView: View { struct InnerCircleView: View {
@@ -48,8 +49,10 @@ struct InnerCircleView: View {
switch page { switch page {
case SheetView.contacts: case SheetView.contacts:
FindFriendsView() FindFriendsView()
case SheetView.inbox: // case SheetView.inbox: // removing feature for now
InboxView()// test one for now // InboxView()
case SheetView.profile:
AddBasicInfoView()
default: default:
Text("asdf") Text("asdf")
} }
@@ -0,0 +1,186 @@
//
// OnboardingTrio.swift
// nirvana-ios
//
// Created by Arjun Patel on 12/14/21.
//
import SwiftUI
import NavigationStack
struct OnboardingOneView: View {
@EnvironmentObject var navigationStack: NavigationStack
let screenWidth = UIScreen.main.bounds.width
let screenHeight = UIScreen.main.bounds.height
var body: some View {
OnboardingTemplateView(imgName: "undraw_explore_re_8l4v-1", mainLeadingActText: "Be", mainHighlightedActText: "yourself", mainTrailingActText: "again.", subActText: "No more endless feeds, profiles, media, fomo, anxiety...focus on you and be more present.", bottomActArea: AnyView(
VStack {
// little bar to show progress out of three steps
HStack {
Capsule()
.frame(width: 20, height: 5)
.foregroundColor(NirvanaColor.teal)
Capsule()
.frame(width: 5, height: 5)
.foregroundColor(NirvanaColor.teal)
Circle()
.frame(width: 5, height: 5)
.foregroundColor(NirvanaColor.teal)
}
.padding()
HStack {
Button {
self.navigationStack.push(OnboardingTwo())
} label: {
Text("Next")
.fontWeight(.heavy)
.foregroundColor(NirvanaColor.white)
.frame(maxWidth: .infinity)
.padding(.vertical, 20)
.background(NirvanaColor.teal)
.clipShape(Capsule())
.shadow(radius:10)
}
// skip to hub
Button {
self.navigationStack.push(InnerCircleView())
} label: {
Text("Skip")
.font(.caption)
.foregroundColor(NirvanaColor.teal)
}
}
}
))
}
}
struct OnboardingTrioView_Previews: PreviewProvider {
static var previews: some View {
OnboardingOneView().environmentObject(AuthSessionStore())
}
}
struct OnboardingTwo: View {
@EnvironmentObject var navigationStack: NavigationStack
var body: some View {
OnboardingTemplateView(imgName: "undraw_connection_b-38-q", mainLeadingActText: "Be picky about your", mainHighlightedActText: "inner circle.", mainTrailingActText: "", subActText: "You are who you hang out with. We kept things minimal because less is more...and we care.", bottomActArea: AnyView(
VStack {
// little bar to show progress out of three steps
HStack {
Capsule()
.frame(width: 5, height: 5)
.foregroundColor(NirvanaColor.teal)
Capsule()
.frame(width: 20, height: 5)
.foregroundColor(NirvanaColor.teal)
Circle()
.frame(width: 5, height: 5)
.foregroundColor(NirvanaColor.teal)
}
.padding()
HStack {
Button {
self.navigationStack.pop()
} label: {
Label("back", systemImage:"chevron.left")
.labelStyle(.iconOnly)
.font(.title2)
.foregroundColor(NirvanaColor.teal)
.padding()
.background(.ultraThinMaterial)
.clipShape(Capsule())
.shadow(radius:10)
}
Button {
self.navigationStack.push(OnboardingTwo())
} label: {
Text("Next")
.fontWeight(.heavy)
.foregroundColor(NirvanaColor.white)
.frame(maxWidth: .infinity)
.padding(.vertical, 20)
.background(NirvanaColor.teal)
.clipShape(Capsule())
.shadow(radius:10)
}
// skip to hub
Button {
self.navigationStack.push(InnerCircleView())
} label: {
Text("Skip")
.font(.caption)
.foregroundColor(NirvanaColor.teal)
}
}
}
))
}
}
struct OnboardingThree: View {
@EnvironmentObject var navigationStack: NavigationStack
var body: some View {
OnboardingTemplateView(imgName: "undraw_voice_assistant_nrv7", mainLeadingActText: "Buttery smooth convos with your", mainHighlightedActText: "authentic voice.", mainTrailingActText: "", subActText: "Less screen time, no more meaningless texts. Start mindfully conversing without all of the noise.", bottomActArea: AnyView(
VStack {
// little bar to show progress out of three steps
HStack {
Capsule()
.frame(width: 5, height: 5)
.foregroundColor(NirvanaColor.teal)
Capsule()
.frame(width: 5, height: 5)
.foregroundColor(NirvanaColor.teal)
Circle()
.frame(width: 20, height: 5)
.foregroundColor(NirvanaColor.teal)
}
.padding()
HStack {
Button {
self.navigationStack.pop()
} label: {
Label("back", systemImage:"chevron.left")
.labelStyle(.iconOnly)
.font(.title2)
.foregroundColor(NirvanaColor.teal)
.padding()
.background(.ultraThinMaterial)
.clipShape(Capsule())
.shadow(radius:10)
}
Button {
self.navigationStack.push(OnboardingTwo())
} label: {
Text("Get Started")
.fontWeight(.heavy)
.foregroundColor(NirvanaColor.white)
.frame(maxWidth: .infinity)
.padding(.vertical, 20)
.background(NirvanaColor.teal)
.clipShape(Capsule())
.shadow(radius:10)
}
}
}
))
}
}
@@ -1,72 +0,0 @@
//
// OnboardingTrio.swift
// nirvana-ios
//
// Created by Arjun Patel on 12/14/21.
//
import SwiftUI
import NavigationStack
struct OnboardingTrioView: View {
@EnvironmentObject var navigationStack: NavigationStack
var body: some View {
ZStack(alignment: .topLeading) {
TabView {
OnboardingTemplateView(imgName: "undraw_through_the_park_lxnl", mainLeadingActText: "Be", mainHighlightedActText: "yourself", mainTrailingActText: "again.", subActText: "No more endless feeds, profiles, media, fomo, anxiety...focus on you and be more present.")
OnboardingTemplateView(imgName: "undraw_connection_b-38-q", mainLeadingActText: "Be picky about your", mainHighlightedActText: "inner circle.", mainTrailingActText: "", subActText: "You are who you hang out with. We kept things minimal because less is more...and we care.")
OnboardingTemplateView(imgName: "undraw_voice_assistant_nrv7", mainLeadingActText: "Buttery smooth convos with your", mainHighlightedActText: "authentic voice.", mainTrailingActText: "", subActText: "Less screen time, no more meaningless texts. Start mindfully conversing without all of the noise.", bottomActArea: AnyView(
VStack {
Button {
self.navigationStack.push(AddBasicInfoView())
} label: {
Text("Get Started")
.bold()
.foregroundColor(NirvanaColor.white)
.frame(maxWidth: .infinity)
.padding()
.background(NirvanaColor.teal)
.clipShape(Capsule())
.shadow(radius:10)
}
}.padding(.bottom, 30)
)
)
}
.navigationBarHidden(true)
.tabViewStyle(.page(indexDisplayMode: .automatic))
.ignoresSafeArea(.all)
HStack(alignment: .center) {
Button {
self.navigationStack.pop()
} label: {
Label("back", systemImage:"chevron.left")
.labelStyle(.iconOnly)
.font(.title2)
}
Spacer()
Button {
self.navigationStack.push(AddBasicInfoView())
} label: {
Text("Skip")
.foregroundColor(NirvanaColor.dimTeal)
}
}
.padding()
}
}
}
struct OnboardingTrioView_Previews: PreviewProvider {
static var previews: some View {
OnboardingTrioView().environmentObject(AuthSessionStore())
}
}
@@ -55,6 +55,57 @@ struct PhoneCodeVerificationView: View {
if self.verificationCode.count == 6 { if self.verificationCode.count == 6 {
Button { Button {
self.verify()
} label: {
Text("Verify")
.fontWeight(.heavy)
.foregroundColor(NirvanaColor.white)
.frame(maxWidth: .infinity)
.padding(.vertical, 20)
.background(NirvanaColor.teal)
.clipShape(Capsule())
.shadow(radius:10)
}
} else { // show dull button if didn't enter full phone number
Text("Verify")
.foregroundColor(Color.white.opacity(0.2))
.frame(maxWidth: .infinity)
.padding(.vertical, 20)
.background(Color.white.opacity(0.2))
.clipShape(Capsule())
.shadow(radius:10)
.animation(.default)
}
}
))
//back button to home
Button {
print("going back to last page")
self.navigationStack.pop() // goes back to welcome screen
} label: {
Label("Back", systemImage: "chevron.left")
.labelStyle(.iconOnly)
.foregroundColor(NirvanaColor.teal)
.padding()
}
if self.isLoading {
SplashView()
}
}
.alert(self.toastText, isPresented: self.$showToast) {
Button("OK", role: ButtonRole.cancel) { }
} message: {
Text(self.toastSubMessage)
}
}
func verify() {
print("started verification process of code") print("started verification process of code")
//disable focused textfield //disable focused textfield
@@ -116,7 +167,8 @@ struct PhoneCodeVerificationView: View {
switch res { switch res {
case .success(let msg): case .success(let msg):
// then sending to next page // then sending to next page
self.navigationStack.push(OnboardingTrioView()) self.navigationStack.push(OnboardingOneView())
return return
case .error(let error): case .error(let error):
self.isLoading.toggle() self.isLoading.toggle()
@@ -130,54 +182,6 @@ struct PhoneCodeVerificationView: View {
} }
} }
} }
} label: {
Text("Verify")
.bold()
.foregroundColor(NirvanaColor.white)
.frame(maxWidth: .infinity)
.padding(.vertical, 20)
.background(NirvanaColor.teal)
.clipShape(Capsule())
.shadow(radius:10)
}
} else { // show dull button if didn't enter full phone number
Text("Verify")
.foregroundColor(Color.white.opacity(0.2))
.frame(maxWidth: .infinity)
.padding(.vertical, 20)
.background(Color.white.opacity(0.2))
.clipShape(Capsule())
.shadow(radius:10)
.animation(.default)
}
}
))
//back button to home
Button {
print("going back to last page")
self.navigationStack.pop() // goes back to welcome screen
} label: {
Label("Back", systemImage: "chevron.left")
.labelStyle(.iconOnly)
.foregroundColor(NirvanaColor.teal)
.padding()
}
if self.isLoading {
SplashView()
}
}
.alert(self.toastText, isPresented: self.$showToast) {
Button("OK", role: ButtonRole.cancel) { }
} message: {
Text(self.toastSubMessage)
}
} }
} }
@@ -123,7 +123,7 @@ struct OnboardingTemplateView_Previews: PreviewProvider {
VStack(alignment: .center) { VStack(alignment: .center) {
NavigationLink(destination: HomeView()) { NavigationLink(destination: HomeView()) {
Text("Start Your Detox") Text("Start Your Detox")
.bold() .fontWeight(.heavy)
.foregroundColor(NirvanaColor.white) .foregroundColor(NirvanaColor.white)
.frame(maxWidth: .infinity) .frame(maxWidth: .infinity)
.padding(.vertical, 20) .padding(.vertical, 20)