ios_app/Shared/yobbleApp.swift
2025-07-12 02:41:46 +03:00

34 lines
900 B
Swift
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// volnahubApp.swift
// Shared
//
// Created by cheykrym on 09/06/2025.
//
import SwiftUI
//@AppStorage("isLoggedIn") var isLoggedIn: Bool = false
//@AppStorage("isDarkMode") private var isDarkMode: Bool = false
//@AppStorage("currentUser") var currentUser: String = ""
@main
struct volnahubApp: App {
@AppStorage("isDarkMode") private var isDarkMode: Bool = true
@StateObject private var viewModel = LoginViewModel()
var body: some Scene {
WindowGroup {
ZStack {
Color(isDarkMode ? .black : .white) // Фон в зависимости от темы
if viewModel.isLoggedIn {
MainView(viewModel: viewModel)
} else {
LoginView(viewModel: viewModel)
}
}
.preferredColorScheme(isDarkMode ? .dark : .light)
}
}
}