initial commit: Proximity iOS app proposal, full Swift code scaffold, reference backend, testing docs, generated Xcode project
This commit is contained in:
60
Proximity/Views/SignInView.swift
Normal file
60
Proximity/Views/SignInView.swift
Normal file
@@ -0,0 +1,60 @@
|
||||
import SwiftUI
|
||||
|
||||
/// The sign-in screen.
|
||||
///
|
||||
/// Auth here is about **account identity** — who you are to the app — not
|
||||
/// about what you reveal to others. The copy makes clear that signing in
|
||||
/// never makes you discoverable; you must separately choose to be present.
|
||||
struct SignInView: View {
|
||||
@EnvironmentObject private var authService: AuthService
|
||||
|
||||
var body: some View {
|
||||
VStack(spacing: 32) {
|
||||
Spacer()
|
||||
|
||||
VStack(spacing: 12) {
|
||||
Image(systemName: "dot.radiowaves.left.and.right")
|
||||
.font(.system(size: 64))
|
||||
.foregroundColor(.green)
|
||||
Text("Proximity")
|
||||
.font(.largeTitle.bold())
|
||||
Text("A social network you can only enter\nby being physically present.")
|
||||
.multilineTextAlignment(.center)
|
||||
.foregroundColor(.secondary)
|
||||
}
|
||||
|
||||
Spacer()
|
||||
|
||||
VStack(spacing: 12) {
|
||||
SignInWithAppleButton { request in
|
||||
request.requestedScopes = [.fullName, .email]
|
||||
} onCompletion: { result in
|
||||
// Handled via AppleAuthProvider in AuthService.
|
||||
}
|
||||
.frame(height: 50)
|
||||
.signInWithAppleButtonStyle(.black)
|
||||
|
||||
Button {
|
||||
Task { try? await authService.signIn(with: .google) }
|
||||
} label: {
|
||||
HStack {
|
||||
Image(systemName: "g.circle.fill")
|
||||
Text("Continue with Google")
|
||||
}
|
||||
.frame(maxWidth: .infinity)
|
||||
.padding()
|
||||
.background(Color(.secondarySystemBackground))
|
||||
.clipShape(RoundedRectangle(cornerRadius: 12))
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
}
|
||||
.padding(.horizontal)
|
||||
|
||||
Text("Signing in never makes you discoverable.\nYou choose to be present separately.")
|
||||
.font(.caption)
|
||||
.foregroundColor(.secondary)
|
||||
.multilineTextAlignment(.center)
|
||||
.padding(.bottom, 24)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user