jel/Jel/Views/ContentView.swift

43 lines
846 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
2023-12-13 00:51:54 +00:00
import PulseUI
2023-12-11 19:27:48 +00:00
struct ContentView: View {
2023-12-12 06:22:43 +00:00
@ObservedObject var authState: AuthStateController
2023-12-13 00:51:54 +00:00
@State var showingConsoleSheet: Bool = false
2023-12-12 06:22:43 +00:00
var body: some View {
2023-12-13 00:51:54 +00:00
VStack {
Button {
showingConsoleSheet.toggle()
} label: {
Label("Console", systemImage: "network")
}
.sheet(isPresented: $showingConsoleSheet) {
ConsoleSheetView(showingConsoleSheet: $showingConsoleSheet)
}
if !authState.loggedIn {
SignInView(authState: authState)
} else {
Text("Logged in")
Button("Log out") {
authState.loggedIn = false
authState.save()
2023-12-11 19:27:48 +00:00
}
2023-12-13 00:51:54 +00:00
}
2023-12-11 19:27:48 +00:00
}
2023-12-13 00:51:54 +00:00
.padding()
}
2023-12-11 19:27:48 +00:00
}
#Preview {
2023-12-12 06:22:43 +00:00
ContentView(authState: AuthStateController())
2023-12-11 19:27:48 +00:00
}