fix(account): Anmelden-Button + ManaAuthGate-Wiring
AccountView hatte zwar einen Status-Text aber keinen Login-Button,
und der ManaAuthGate war überhaupt nicht im App-Tree eingebaut —
Guest-Mode-User konnten sich nirgends anmelden.
- ZitareNativeApp: ManaAuthGate(auth:) instantiiert + via environment
durchgereicht
- RootView: .manaBrand(ZitareBrand.manaBrand) +
.manaAuthGate(authGate) { ManaLoginView(…) } für globales
Sign-In-Sheet
- AccountView: authActionCard mit "Mit mana-Konto anmelden" /
"Abmelden" (keepGuestMode: true)
- ZitareBrand neu (paper-Theme-Brücke zu ManaBrandConfig)
- project.yml: platformFilter: iOS für Widget+Share-Extensions
(macOS-Build war pre-existing kaputt mit "embedded iOS content")
iOS + macOS BUILD SUCCEEDED.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
d8f3a1402c
commit
7ba8684074
5 changed files with 76 additions and 2 deletions
|
|
@ -1,13 +1,21 @@
|
|||
import ManaAuthUI
|
||||
import ManaCore
|
||||
import SwiftUI
|
||||
|
||||
/// Phase ζ-0 minimal: zeigt Auth-Status und Healthz-Probe-Ergebnis.
|
||||
/// Phase ζ-3 erweitert um ManaAuthUI-Login-Sheet und Submission-
|
||||
/// History-Link (via WebShell auf `zitare.mana.how/me`).
|
||||
/// Phase ζ-3 erweitert um Submission-History-Link (via WebShell auf
|
||||
/// `zitare.mana.how/me`). Login-Sheet schon hier, damit Guests einen
|
||||
/// Anmelden-Button finden.
|
||||
struct AccountView: View {
|
||||
@Environment(AuthClient.self) private var auth
|
||||
@Environment(ManaAuthGate.self) private var authGate
|
||||
let healthStatus: HealthStatus
|
||||
|
||||
private var isSignedIn: Bool {
|
||||
if case .signedIn = auth.status { return true }
|
||||
return false
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
ScrollView {
|
||||
VStack(spacing: 24) {
|
||||
|
|
@ -15,6 +23,8 @@ struct AccountView: View {
|
|||
|
||||
statusCard
|
||||
|
||||
authActionCard
|
||||
|
||||
Spacer(minLength: 32)
|
||||
|
||||
aboutCard
|
||||
|
|
@ -25,6 +35,30 @@ struct AccountView: View {
|
|||
.background(ZitareTheme.background)
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
private var authActionCard: some View {
|
||||
if isSignedIn {
|
||||
Button(role: .destructive) {
|
||||
Task { await auth.signOut(keepGuestMode: true) }
|
||||
} label: {
|
||||
Label("Abmelden", systemImage: "arrow.left.square")
|
||||
.frame(maxWidth: .infinity)
|
||||
}
|
||||
.buttonStyle(.bordered)
|
||||
.controlSize(.large)
|
||||
} else {
|
||||
Button {
|
||||
authGate.isPresentingSignIn = true
|
||||
} label: {
|
||||
Label("Mit mana-Konto anmelden", systemImage: "arrow.right.square")
|
||||
.frame(maxWidth: .infinity)
|
||||
}
|
||||
.buttonStyle(.borderedProminent)
|
||||
.controlSize(.large)
|
||||
.tint(ZitareTheme.primary)
|
||||
}
|
||||
}
|
||||
|
||||
private var header: some View {
|
||||
VStack(spacing: 12) {
|
||||
// Eigenes Anführungszeichen-Glyph in der gleichen Variante
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue