diff options
| author | Dustin Mierau <dustin@mierau.me> | 2023-12-06 13:52:20 -0800 |
|---|---|---|
| committer | Dustin Mierau <dustin@mierau.me> | 2023-12-06 13:52:20 -0800 |
| commit | c0068f11c51bb587c16dfacb73629b3c6fb67fc8 (patch) | |
| tree | 20753433f348b03bb590e0fe6a4cafbe56f4c859 /Hotline/Views/UserListView.swift | |
| parent | 06a2166415bca7e5fe32eac505859bdd690ab8e0 (diff) | |
Further work on UI organization
Diffstat (limited to 'Hotline/Views/UserListView.swift')
| -rw-r--r-- | Hotline/Views/UserListView.swift | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/Hotline/Views/UserListView.swift b/Hotline/Views/UserListView.swift index 70b58b9..cae1d0c 100644 --- a/Hotline/Views/UserListView.swift +++ b/Hotline/Views/UserListView.swift @@ -4,14 +4,32 @@ struct UserListView: View { @Environment(HotlineClient.self) private var hotline var body: some View { - VStack(spacing: 0) { - List(hotline.userList) { u in - HStack(alignment: .firstTextBaseline) { - Text(u.name).bold().foregroundStyle(u.isAdmin ? Color.red : Color.black).opacity(u.isIdle ? 0.5 : 1.0) + NavigationStack { + VStack(spacing: 0) { + List(hotline.userList) { u in + HStack(alignment: .firstTextBaseline) { + Text(u.name).bold().foregroundStyle(u.isAdmin ? Color.red : Color.black).opacity(u.isIdle ? 0.5 : 1.0) + } + } + .listStyle(.plain) + .padding() + } + .navigationBarTitleDisplayMode(.inline) + .toolbar { + ToolbarItem(placement: .principal) { + Text(hotline.server?.name ?? "") + .font(.headline) + } + ToolbarItem(placement: .navigationBarLeading) { + Button { + hotline.disconnect() + } label: { + Image(systemName: "xmark.circle.fill") + .symbolRenderingMode(.hierarchical) + .foregroundColor(.secondary) + } } } - .listStyle(.plain) - .padding() } } } |