Skip to content

Commit e5f4cc4

Browse files
committed
feat: add GitHub connection alert in dashboard
- Introduced a conditional alert in the dashboard that prompts users to connect their GitHub account if they have uncompleted achievements related to GitHub status. - The alert includes a message and a button to close the share drawer, enhancing user guidance for creating a share drawer type. - Maintained existing functionality for displaying share drawer content when the GitHub connection is not required.
1 parent 0938807 commit e5f4cc4

File tree

1 file changed

+34
-7
lines changed

1 file changed

+34
-7
lines changed

lib/algora_web/live/org/dashboard_live.ex

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1379,13 +1379,40 @@ defmodule AlgoraWeb.Org.DashboardLive do
13791379
<.form for={@contract_form} phx-change="validate_contract" phx-submit="create_contract">
13801380
<div class="flex flex-col gap-8">
13811381
<.share_drawer_developer_info selected_developer={@selected_developer} />
1382-
<.share_drawer_content
1383-
:if={@selected_developer}
1384-
share_drawer_type={@share_drawer_type}
1385-
contract_form={@contract_form}
1386-
tip_form={@tip_form}
1387-
bounty_form={@bounty_form}
1388-
/>
1382+
<%= if @achievements |> Enum.any?(& &1.id == :connect_github_status and &1.status != :completed ) do %>
1383+
<div class="relative">
1384+
<div class="absolute inset-0 z-10 bg-background/50" />
1385+
<div class="pointer-events-none">
1386+
<.share_drawer_content
1387+
:if={@selected_developer}
1388+
share_drawer_type={@share_drawer_type}
1389+
contract_form={@contract_form}
1390+
tip_form={@tip_form}
1391+
bounty_form={@bounty_form}
1392+
/>
1393+
</div>
1394+
<.alert
1395+
variant="default"
1396+
class="absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 z-20 w-auto flex flex-col items-center justify-center gap-2 text-center"
1397+
>
1398+
<.alert_title>Connect GitHub</.alert_title>
1399+
<.alert_description>
1400+
Connect your GitHub account to create a {@share_drawer_type}.
1401+
</.alert_description>
1402+
<.button phx-click="close_share_drawer" type="button" variant="subtle">
1403+
Go back
1404+
</.button>
1405+
</.alert>
1406+
</div>
1407+
<% else %>
1408+
<.share_drawer_content
1409+
:if={@selected_developer}
1410+
share_drawer_type={@share_drawer_type}
1411+
contract_form={@contract_form}
1412+
tip_form={@tip_form}
1413+
bounty_form={@bounty_form}
1414+
/>
1415+
<% end %>
13891416
</div>
13901417
</.form>
13911418
</.drawer_content>

0 commit comments

Comments
 (0)