initial commit
This commit is contained in:
36
ios_client/EncryptedChat/App/EncryptedChatApp.swift
Normal file
36
ios_client/EncryptedChat/App/EncryptedChatApp.swift
Normal file
@@ -0,0 +1,36 @@
|
||||
import SwiftUI
|
||||
|
||||
@main
|
||||
struct EncryptedChatApp: App {
|
||||
@State private var appState = AppState()
|
||||
@State private var authViewModel = AuthViewModel()
|
||||
|
||||
var body: some Scene {
|
||||
WindowGroup {
|
||||
if appState.isLoggedIn {
|
||||
MainTabView(appState: appState)
|
||||
} else {
|
||||
LoginView(viewModel: authViewModel, appState: appState)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct MainTabView: View {
|
||||
var appState: AppState
|
||||
@State private var convListVM = ConversationListVM()
|
||||
|
||||
var body: some View {
|
||||
TabView {
|
||||
ConversationListView(appState: appState, viewModel: convListVM)
|
||||
.tabItem {
|
||||
Label("Chats", systemImage: "bubble.left.and.bubble.right.fill")
|
||||
}
|
||||
|
||||
ProfileView(appState: appState, isOwnProfile: true)
|
||||
.tabItem {
|
||||
Label("Profile", systemImage: "person.fill")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user