diff options
| author | Dustin Mierau <dustin@mierau.me> | 2023-12-04 14:31:12 -0800 |
|---|---|---|
| committer | Dustin Mierau <dustin@mierau.me> | 2023-12-04 14:31:12 -0800 |
| commit | b1a176ba3da2c7cf815084f0f8109008fe763809 (patch) | |
| tree | 5bbf52900d5dab9091216cc0f1e5dc84ad69cc9f /Hotline/Views/UserListView.swift | |
| parent | 471546236b8991f61d26c0e3aa8ee48b83b983af (diff) | |
Starting to get app views displaying data (roughly)
Diffstat (limited to 'Hotline/Views/UserListView.swift')
| -rw-r--r-- | Hotline/Views/UserListView.swift | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Hotline/Views/UserListView.swift b/Hotline/Views/UserListView.swift new file mode 100644 index 0000000..cbb029d --- /dev/null +++ b/Hotline/Views/UserListView.swift @@ -0,0 +1,21 @@ +import SwiftUI + +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) + } + } + .padding() + } + } +} + +#Preview { + ChatView() + .environment(HotlineClient()) +} |