Sidebar footer opens a popover (not Menu — its AppKit-bridged label rendering broke on click with an avatar image in it) with profile, keyboard shortcuts, docs/feedback links, and log out. About panel and a minimal Preferences window round out the app-menu affordances.
41 lines
1.3 KiB
Swift
41 lines
1.3 KiB
Swift
#if os(macOS)
|
|
import SwiftUI
|
|
|
|
struct PreferencesView: View {
|
|
@Environment(SessionStore.self) private var session
|
|
@AppStorage("outpost.appearance") private var appearance: AppAppearance = .system
|
|
@State private var isShowingLogoutConfirmation = false
|
|
|
|
var body: some View {
|
|
Form {
|
|
Section("Appearance") {
|
|
Picker("Appearance", selection: $appearance) {
|
|
ForEach(AppAppearance.allCases) { option in
|
|
Text(option.label).tag(option)
|
|
}
|
|
}
|
|
.pickerStyle(.segmented)
|
|
.labelsHidden()
|
|
}
|
|
|
|
Section("Account") {
|
|
LabeledContent("Signed in as", value: session.userName ?? "—")
|
|
if let email = session.userEmail {
|
|
LabeledContent("Email", value: email)
|
|
}
|
|
if let teamName = session.teamName {
|
|
LabeledContent("Workspace", value: teamName)
|
|
}
|
|
|
|
Button("Log Out…", role: .destructive) {
|
|
isShowingLogoutConfirmation = true
|
|
}
|
|
}
|
|
}
|
|
.formStyle(.grouped)
|
|
.frame(width: 380, height: 300)
|
|
.logoutConfirmationDialog(isPresented: $isShowingLogoutConfirmation, session: session)
|
|
}
|
|
}
|
|
#endif
|