diff options
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()) +} |