jel/Jel/Views/ContentView.swift

31 lines
572 B
Swift
Raw Normal View History

2023-12-11 19:27:48 +00:00
//
// ContentView.swift
// Jel
//
// Created by zerocool on 12/11/23.
//
import SwiftUI
struct ContentView: View {
2023-12-12 06:22:43 +00:00
@ObservedObject var authState: AuthStateController
var body: some View {
2023-12-11 19:27:48 +00:00
VStack {
2023-12-12 06:22:43 +00:00
if !authState.loggedIn {
2023-12-12 22:09:15 +00:00
SignInView(authState: authState)
2023-12-12 06:22:43 +00:00
} else {
Text("Logged in")
Button("Log out") {
authState.loggedIn = false
authState.save()
}
}
2023-12-11 19:27:48 +00:00
}
.padding()
}
}
#Preview {
2023-12-12 06:22:43 +00:00
ContentView(authState: AuthStateController())
2023-12-11 19:27:48 +00:00
}