Skip to content

Commit 6c1a362

Browse files
committed
hide contacts on sidebar for now
1 parent a18f52a commit 6c1a362

File tree

2 files changed

+26
-22
lines changed

2 files changed

+26
-22
lines changed

lib/algora_web/components/layouts/org.html.heex

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,23 @@
2929
</ul>
3030

3131
<.separator class="mx-auto my-4 w-2/3" />
32-
<!-- Online users section -->
32+
<!-- Chat section -->
3333
<ul role="list" class="space-y-1">
34-
<%= for user <- @online_users do %>
34+
<%= for contact <- @contacts do %>
3535
<li>
36+
<!-- TODO: navigate to chat -->
3637
<.link
3738
class="flex justify-center p-2"
38-
navigate={Algora.Accounts.User.url(user)}
39-
title={Algora.Accounts.User.handle(user)}
39+
navigate={Algora.Accounts.User.url(contact)}
40+
title={Algora.Accounts.User.handle(contact)}
4041
>
4142
<div class="relative inline-block">
4243
<div class="relative h-8 w-8 flex-shrink-0 overflow-hidden rounded-full">
4344
<img
44-
alt={Algora.Accounts.User.handle(user)}
45+
alt={Algora.Accounts.User.handle(contact)}
4546
loading="lazy"
4647
decoding="async"
47-
src={user.avatar_url}
48+
src={contact.avatar_url}
4849
class="h-full w-full object-cover"
4950
/>
5051
</div>

lib/algora_web/live/org/nav.ex

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,32 @@ defmodule AlgoraWeb.Org.Nav do
88

99
def on_mount(:default, %{"org_handle" => org_handle}, _session, socket) do
1010
current_org = Organizations.get_org_by(handle: org_handle)
11-
members = Organizations.list_org_members(current_org)
12-
contractors = Organizations.list_org_contractors(current_org)
1311

14-
online_users =
15-
(contractors ++ members)
16-
|> Enum.uniq_by(& &1.id)
17-
|> Enum.reject(&(&1.id == socket.assigns.current_user.id))
18-
|> Enum.map(fn user ->
19-
%{
20-
id: user.id,
21-
name: user.name || user.handle,
22-
handle: user.handle,
23-
avatar_url: user.avatar_url,
24-
type: :individual
25-
}
26-
end)
12+
# TODO: restore once chat is implemented
13+
contacts = []
14+
15+
# members = Organizations.list_org_members(current_org)
16+
# contractors = Organizations.list_org_contractors(current_org)
17+
# contacts =
18+
# (contractors ++ members)
19+
# |> Enum.uniq_by(& &1.id)
20+
# |> Enum.reject(&(&1.id == socket.assigns.current_user.id))
21+
# |> Enum.map(fn user ->
22+
# %{
23+
# id: user.id,
24+
# name: user.name || user.handle,
25+
# handle: user.handle,
26+
# avatar_url: user.avatar_url,
27+
# type: :individual
28+
# }
29+
# end)
2730

2831
{:cont,
2932
socket
3033
|> assign(:new_bounty_form, to_form(%{"github_issue_url" => "", "amount" => ""}))
3134
|> assign(:current_org, current_org)
3235
|> assign(:nav, nav_items(current_org.handle))
33-
|> assign(:online_users, online_users)
36+
|> assign(:contacts, contacts)
3437
|> attach_hook(:active_tab, :handle_params, &handle_active_tab_params/3)}
3538
end
3639

0 commit comments

Comments
 (0)