From f06208ec66a3d0dc06591b2eea17662c1b8584de Mon Sep 17 00:00:00 2001 From: Woit Date: Tue, 19 Nov 2024 15:19:28 +0100 Subject: [PATCH] wip --- Monal/another.im/AnotherIMApp.swift | 7 +++++-- Monal/another.im/Views/RootView.swift | 24 +++++++++++++++++------- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/Monal/another.im/AnotherIMApp.swift b/Monal/another.im/AnotherIMApp.swift index 12ddadd..4568126 100644 --- a/Monal/another.im/AnotherIMApp.swift +++ b/Monal/another.im/AnotherIMApp.swift @@ -1,3 +1,4 @@ +import SwiftfulRouting import SwiftUI @main @@ -6,8 +7,10 @@ struct AnotherIMApp: App { var body: some Scene { WindowGroup { - RootView() - .environmentObject(wrapper) + RouterView { _ in + RootView() + } + .environmentObject(wrapper) } } } diff --git a/Monal/another.im/Views/RootView.swift b/Monal/another.im/Views/RootView.swift index 51c6472..9a94353 100644 --- a/Monal/another.im/Views/RootView.swift +++ b/Monal/another.im/Views/RootView.swift @@ -2,17 +2,27 @@ import SwiftUI struct RootView: View { @EnvironmentObject var wrapper: MonalXmppWrapper + @Environment(\.router) var router var body: some View { - VStack { - Image(systemName: "globe") - .imageScale(.large) - .foregroundStyle(.tint) - Text("Hello, world!") + ZStack { + Color.Material.Background.dark + Image(.aimLogo) + .resizable() + .frame(width: 200, height: 200) } - .padding() + .ignoresSafeArea() .onAppear { - print("test") + switch wrapper.accountsAvailability { + case .noAccounts: + break + + case .someEnabled: + break + + case .allDisabled: + break + } } } }