Add minimal sign-in page
This commit is contained in:
1 parent
36f2b2d843
commit
13d8597eea
4 files changed
+228
-15
No files matched your search
+28
-15
@@ -1,24 +1,37 @@
|
||||
//
|
||||
// ContentView.swift
|
||||
// Music
|
||||
//
|
||||
// Created by Lucas Täkker on 06/10/2026.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct ContentView: View {
|
||||
@StateObject private var session = AuthSessionStore()
|
||||
|
||||
var body: some View {
|
||||
VStack {
|
||||
Image(systemName: "globe")
|
||||
.imageScale(.large)
|
||||
.foregroundStyle(.tint)
|
||||
Text("Hello, world!")
|
||||
Group {
|
||||
switch session.state {
|
||||
case .checking:
|
||||
ProgressView()
|
||||
.tint(.red)
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
.background(Color(uiColor: .systemBackground))
|
||||
.accessibilityLabel("Checking sign-in")
|
||||
case .signedOut:
|
||||
SignInView(session: session)
|
||||
case .signedIn:
|
||||
VStack(spacing: 12) {
|
||||
Image(systemName: "music.note.list")
|
||||
.imageScale(.large)
|
||||
.foregroundStyle(.tint)
|
||||
Text("Hello, world!")
|
||||
}
|
||||
.padding()
|
||||
}
|
||||
}
|
||||
.task {
|
||||
await session.restoreSession()
|
||||
}
|
||||
.padding()
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
ContentView()
|
||||
struct ContentView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
ContentView()
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user