aboutsummaryrefslogtreecommitdiff
path: root/Hotline/Views/ServerView.swift
blob: 1610aa7247b5bb6cb63f78ccf40dd0500d4f6ae7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import SwiftUI

struct ServerView: View {
  @Environment(HotlineClient.self) private var hotline
  @Environment(HotlineTrackerClient.self) private var tracker
  
  @State private var isTrackerVisible = false
  
  var body: some View {
    TabView {
      NavigationView {
        ChatView()
          .navigationTitle("Badmoon")
          .navigationBarItems(
            leading: Button(action: {
              withAnimation {
                isTrackerVisible.toggle()
              }
            }) {
              Image(systemName: "line.horizontal.3") // Hamburger icon or similar
                .imageScale(.large)
            }
          )
          .toolbarBackground(.visible, for: .navigationBar)
          .toolbarBackground(.red, for: .navigationBar)
      }
      .navigationBarTitleDisplayMode(.inline)
      .tabItem {
        Image(systemName: "message")
      }
      
      Text("Users")
        .tabItem {
          Image(systemName: "person.fill")
        }
      
      Text("News")
        .tabItem {
          Image(systemName: "newspaper")
        }
      
      Text("Files")
        .tabItem {
          Image(systemName: "folder")
        }
      
      Text("Transfers")
        .tabItem {
          Image(systemName: "network")
        }
    }
//      .sheet(isPresented: Binding(get: { hotline.connectionStatus != .loggedIn }, set: { _ in })) {
//        TrackerView()
//      }
  }
}

#Preview {
  ServerView()
    .environment(HotlineClient())
    .environment(HotlineTrackerClient(tracker: HotlineTracker("hltracker.com")))
}