filter view

all workout filter view is its own view
all workout filter view is the top of all workout view
This commit is contained in:
Trey t
2024-11-25 09:48:44 -08:00
parent 63b7a2daa5
commit 4b6352b8fd
4 changed files with 157 additions and 105 deletions

View File

@@ -14,6 +14,11 @@ struct LoginView: View {
let completion: (() -> Void)
@State var doingNetworkShit: Bool = false
@State var errorTitle = ""
@State var errorMessage = ""
@State var hasError: Bool = false
var body: some View {
VStack {
TextField("Email", text: $email)
@@ -65,6 +70,11 @@ struct LoginView: View {
.edgesIgnoringSafeArea(.all)
.scaledToFill()
)
.alert(errorTitle, isPresented: $hasError, actions: {
}, message: {
})
}
func login() {
@@ -78,6 +88,10 @@ struct LoginView: View {
if success {
completion()
dismiss()
} else {
errorTitle = "error logging in"
errorMessage = "invalid credentials"
hasError = true
}
})
}