36 lines
976 B
Swift
36 lines
976 B
Swift
// LockInBroApp.swift — App entry point with menu bar + main window
|
|
|
|
import SwiftUI
|
|
|
|
@main
|
|
struct LockInBroApp: App {
|
|
@State private var auth = AuthManager.shared
|
|
@State private var session = SessionManager.shared
|
|
|
|
var body: some Scene {
|
|
// Main window
|
|
WindowGroup("LockInBro") {
|
|
ContentView()
|
|
.environment(auth)
|
|
.environment(session)
|
|
}
|
|
.defaultSize(width: 840, height: 580)
|
|
|
|
// Menu bar extra
|
|
MenuBarExtra {
|
|
MenuBarView()
|
|
.environment(auth)
|
|
.environment(session)
|
|
} label: {
|
|
// Show a filled icon when a session is active
|
|
if session.isSessionActive {
|
|
Image(systemName: "brain.head.profile")
|
|
.symbolEffect(.pulse)
|
|
} else {
|
|
Image(systemName: "brain.head.profile")
|
|
}
|
|
}
|
|
.menuBarExtraStyle(.window)
|
|
}
|
|
}
|