making things smoother and such with button for continuation on add basic info page

This commit is contained in:
talksik
2021-12-18 20:22:41 -08:00
parent 48c433a7a3
commit c506853358
2 changed files with 11 additions and 4 deletions
+4 -1
View File
@@ -147,7 +147,10 @@ final class AuthSessionStore: ObservableObject, SessionStore {
// if we get a user back, then set this to our instance to allow UI to get published with all user details // if we get a user back, then set this to our instance to allow UI to get published with all user details
if firestoreUser != nil { if firestoreUser != nil {
self.user = firestoreUser // TODO: prolly useless since we never set up a background thread for the rest of this code before
DispatchQueue.main.async {
self.user = firestoreUser
}
} }
} }
} }
@@ -105,6 +105,11 @@ struct AddBasicInfoView: View {
// button to save information // button to save information
Button { Button {
if self.firstName.count == 0 || self.lastName.count == 0 {
print("do nothing...user didn't input anything...maybe show an alert")
return
}
print("saving information") print("saving information")
// activate loading splashscreen // activate loading splashscreen
@@ -119,12 +124,11 @@ struct AddBasicInfoView: View {
.foregroundColor(Color.white) .foregroundColor(Color.white)
.frame(maxWidth: .infinity) .frame(maxWidth: .infinity)
.padding(.vertical, 20) .padding(.vertical, 20)
.background(NirvanaColor.teal) .background(self.firstName.count == 0 || self.lastName.count == 0 ? Color.white.opacity(0.3) : NirvanaColor.teal)
.clipShape(Capsule()) .clipShape(Capsule())
.shadow(radius:10) .shadow(radius:10)
} }
.offset(x: 0, y: self.firstName.count == 0 || self.lastName.count == 0 ? 200 : 0) .animation(.default)
.animation(.spring())
.padding() .padding()
} }
.frame(maxHeight: .infinity) .frame(maxHeight: .infinity)