fixing issues and navigation smooth now
This commit is contained in:
@@ -9,8 +9,6 @@ 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()
|
||||||
@@ -24,11 +22,26 @@ 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)
|
||||||
|
.foregroundColor(NirvanaColor.teal)
|
||||||
|
}
|
||||||
|
.padding()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// main content
|
// main content
|
||||||
VStack {
|
VStack {
|
||||||
// header logo area
|
// header logo area
|
||||||
@@ -125,13 +138,7 @@ 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},
|
||||||
|
|||||||
@@ -9,10 +9,8 @@ import SwiftUI
|
|||||||
import Contacts
|
import Contacts
|
||||||
import NavigationStack
|
import NavigationStack
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct FindFriendsView: View {
|
struct FindFriendsView: View {
|
||||||
@Environment(\.dismiss) var dismiss
|
@EnvironmentObject var navigationStack : NavigationStack
|
||||||
@EnvironmentObject var authSessionStore: AuthSessionStore
|
@EnvironmentObject var authSessionStore: AuthSessionStore
|
||||||
|
|
||||||
@StateObject var contactsVM = ContactsViewModel()
|
@StateObject var contactsVM = ContactsViewModel()
|
||||||
@@ -20,11 +18,41 @@ struct FindFriendsView: View {
|
|||||||
@State private var searchQuery: String = ""
|
@State private var searchQuery: String = ""
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
NavigationView {
|
ZStack {
|
||||||
|
WavesGlassBackgroundView()
|
||||||
|
|
||||||
|
// programmatic back button
|
||||||
|
ZStack(alignment: .topLeading) {
|
||||||
|
Color.clear
|
||||||
|
|
||||||
|
Button {
|
||||||
|
self.navigationStack.pop()
|
||||||
|
} label: {
|
||||||
|
Label("back", systemImage:"chevron.left")
|
||||||
|
.labelStyle(.iconOnly)
|
||||||
|
.font(.title2)
|
||||||
|
.foregroundColor(NirvanaColor.teal)
|
||||||
|
}
|
||||||
|
.padding()
|
||||||
|
}
|
||||||
|
|
||||||
|
// main content
|
||||||
VStack {
|
VStack {
|
||||||
Text("You must have someone in your phone contacts to add them. 🥬")
|
// header logo area
|
||||||
|
LogoHeaderView()
|
||||||
|
|
||||||
|
// action text
|
||||||
|
VStack(alignment: .leading) {
|
||||||
|
Text("Let's add some friends.")
|
||||||
|
.font(.title)
|
||||||
|
.fontWeight(.medium)
|
||||||
|
.foregroundColor(NirvanaColor.teal)
|
||||||
|
.multilineTextAlignment(.center)
|
||||||
|
|
||||||
|
Text("You must have someone in your phone contacts to add them. You can only add 10 people to your circle! 🥬")
|
||||||
.font(.subheadline)
|
.font(.subheadline)
|
||||||
.foregroundColor(Color.gray)
|
.foregroundColor(NirvanaColor.teal)
|
||||||
|
}
|
||||||
|
|
||||||
List {
|
List {
|
||||||
ForEach(searchItems, id: \.self) { key in
|
ForEach(searchItems, id: \.self) { key in
|
||||||
@@ -35,12 +63,6 @@ struct FindFriendsView: View {
|
|||||||
}
|
}
|
||||||
.searchable(text: self.$searchQuery)
|
.searchable(text: self.$searchQuery)
|
||||||
}
|
}
|
||||||
.navigationTitle("Find Friends")
|
|
||||||
.navigationBarItems(trailing: Button(action: {
|
|
||||||
dismiss()
|
|
||||||
}, label: {
|
|
||||||
Text("Cancel")
|
|
||||||
}))
|
|
||||||
}
|
}
|
||||||
.onAppear {
|
.onAppear {
|
||||||
self.contactsVM.fetchContacts()
|
self.contactsVM.fetchContacts()
|
||||||
|
|||||||
@@ -13,22 +13,12 @@ struct CircleNavigationView: View {
|
|||||||
@EnvironmentObject var navigationStack: NavigationStack
|
@EnvironmentObject var navigationStack: NavigationStack
|
||||||
@EnvironmentObject var authSessionStore: AuthSessionStore
|
@EnvironmentObject var authSessionStore: AuthSessionStore
|
||||||
|
|
||||||
@Binding var sheetView: SheetView?
|
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
HStack(alignment: .center) {
|
HStack(alignment: .center) {
|
||||||
Menu {
|
Menu {
|
||||||
Button(role: .destructive) {
|
|
||||||
print("manage inbox")
|
|
||||||
self.sheetView = .inbox
|
|
||||||
} label: {
|
|
||||||
Label("inbox", systemImage: "envelope.badge")
|
|
||||||
.foregroundColor(NirvanaColor.teal)
|
|
||||||
}
|
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
print("going to show contacts now")
|
print("going to show contacts now")
|
||||||
self.sheetView = .contacts
|
self.navigationStack.push(FindFriendsView())
|
||||||
} label: {
|
} label: {
|
||||||
Label("add peeps", systemImage: "person.2.wave.2")
|
Label("add peeps", systemImage: "person.2.wave.2")
|
||||||
.foregroundColor(NirvanaColor.teal)
|
.foregroundColor(NirvanaColor.teal)
|
||||||
@@ -146,6 +136,6 @@ struct CircleNavigationView: View {
|
|||||||
|
|
||||||
struct CircleNavigationView_Previews: PreviewProvider {
|
struct CircleNavigationView_Previews: PreviewProvider {
|
||||||
static var previews: some View {
|
static var previews: some View {
|
||||||
CircleNavigationView(sheetView: .constant(SheetView.contacts)).environmentObject(AuthSessionStore(isPreview: true))
|
CircleNavigationView().environmentObject(AuthSessionStore(isPreview: true))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,20 +8,11 @@
|
|||||||
import SwiftUI
|
import SwiftUI
|
||||||
import NavigationStack
|
import NavigationStack
|
||||||
|
|
||||||
enum SheetView : Identifiable {
|
|
||||||
var id: Self { self }
|
|
||||||
case contacts
|
|
||||||
case inbox
|
|
||||||
case profile
|
|
||||||
}
|
|
||||||
|
|
||||||
struct InnerCircleView: View {
|
struct InnerCircleView: View {
|
||||||
@StateObject var innerCircleVM: InnerCircleViewModel = InnerCircleViewModel()
|
@StateObject var innerCircleVM: InnerCircleViewModel = InnerCircleViewModel()
|
||||||
@EnvironmentObject var authSessionStore: AuthSessionStore
|
@EnvironmentObject var authSessionStore: AuthSessionStore
|
||||||
@EnvironmentObject var navigationStack: NavigationStack
|
@EnvironmentObject var navigationStack: NavigationStack
|
||||||
|
|
||||||
@State var sheetView: SheetView? = nil
|
|
||||||
|
|
||||||
@State var selectedFriendIndex: Int? = nil
|
@State var selectedFriendIndex: Int? = nil
|
||||||
|
|
||||||
let universalSize = UIScreen.main.bounds
|
let universalSize = UIScreen.main.bounds
|
||||||
@@ -40,7 +31,7 @@ struct InnerCircleView: View {
|
|||||||
.padding(.bottom)
|
.padding(.bottom)
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
self.sheetView = SheetView.profile
|
self.navigationStack.push(AddBasicInfoView())
|
||||||
} label: {
|
} label: {
|
||||||
Text("Create Profile")
|
Text("Create Profile")
|
||||||
.fontWeight(.heavy)
|
.fontWeight(.heavy)
|
||||||
@@ -69,7 +60,7 @@ struct InnerCircleView: View {
|
|||||||
.padding(.bottom)
|
.padding(.bottom)
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
self.sheetView = SheetView.contacts
|
self.navigationStack.push(FindFriendsView())
|
||||||
} label: {
|
} label: {
|
||||||
Text("Add Friends")
|
Text("Add Friends")
|
||||||
.fontWeight(.heavy)
|
.fontWeight(.heavy)
|
||||||
@@ -104,26 +95,13 @@ struct InnerCircleView: View {
|
|||||||
// header
|
// header
|
||||||
VStack(alignment: .leading) {
|
VStack(alignment: .leading) {
|
||||||
|
|
||||||
CircleNavigationView(sheetView: self.$sheetView).environmentObject(innerCircleVM)
|
CircleNavigationView().environmentObject(innerCircleVM)
|
||||||
|
|
||||||
Spacer()
|
Spacer()
|
||||||
}
|
}
|
||||||
|
|
||||||
CircleFooterView(selectedFriendIndex: self.$selectedFriendIndex)
|
CircleFooterView(selectedFriendIndex: self.$selectedFriendIndex)
|
||||||
}
|
}
|
||||||
.sheet(item: self.$sheetView) {page in
|
|
||||||
switch page {
|
|
||||||
case SheetView.contacts:
|
|
||||||
FindFriendsView()
|
|
||||||
// case SheetView.inbox: // removing feature for now
|
|
||||||
// InboxView()
|
|
||||||
case SheetView.profile:
|
|
||||||
AddBasicInfoView()
|
|
||||||
default:
|
|
||||||
Text("asdf")
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
.onAppear() {
|
.onAppear() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ struct OnboardingOneView: View {
|
|||||||
.frame(width: 5, height: 5)
|
.frame(width: 5, height: 5)
|
||||||
.foregroundColor(NirvanaColor.teal)
|
.foregroundColor(NirvanaColor.teal)
|
||||||
|
|
||||||
Circle()
|
Capsule()
|
||||||
.frame(width: 5, height: 5)
|
.frame(width: 5, height: 5)
|
||||||
.foregroundColor(NirvanaColor.teal)
|
.foregroundColor(NirvanaColor.teal)
|
||||||
|
|
||||||
@@ -82,7 +82,7 @@ struct OnboardingTwo: View {
|
|||||||
.frame(width: 20, height: 5)
|
.frame(width: 20, height: 5)
|
||||||
.foregroundColor(NirvanaColor.teal)
|
.foregroundColor(NirvanaColor.teal)
|
||||||
|
|
||||||
Circle()
|
Capsule()
|
||||||
.frame(width: 5, height: 5)
|
.frame(width: 5, height: 5)
|
||||||
.foregroundColor(NirvanaColor.teal)
|
.foregroundColor(NirvanaColor.teal)
|
||||||
|
|
||||||
@@ -104,7 +104,7 @@ struct OnboardingTwo: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
self.navigationStack.push(OnboardingTwo())
|
self.navigationStack.push(OnboardingThree())
|
||||||
} label: {
|
} label: {
|
||||||
Text("Next")
|
Text("Next")
|
||||||
.fontWeight(.heavy)
|
.fontWeight(.heavy)
|
||||||
@@ -146,7 +146,7 @@ struct OnboardingThree: View {
|
|||||||
.frame(width: 5, height: 5)
|
.frame(width: 5, height: 5)
|
||||||
.foregroundColor(NirvanaColor.teal)
|
.foregroundColor(NirvanaColor.teal)
|
||||||
|
|
||||||
Circle()
|
Capsule()
|
||||||
.frame(width: 20, height: 5)
|
.frame(width: 20, height: 5)
|
||||||
.foregroundColor(NirvanaColor.teal)
|
.foregroundColor(NirvanaColor.teal)
|
||||||
|
|
||||||
@@ -168,7 +168,7 @@ struct OnboardingThree: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
self.navigationStack.push(OnboardingTwo())
|
self.navigationStack.push(InnerCircleView())
|
||||||
} label: {
|
} label: {
|
||||||
Text("Get Started")
|
Text("Get Started")
|
||||||
.fontWeight(.heavy)
|
.fontWeight(.heavy)
|
||||||
|
|||||||
Reference in New Issue
Block a user