Skip to content

Commit 4814b60

Browse files
committed
update user layout to place drawers on top level
1 parent a6cbe39 commit 4814b60

File tree

1 file changed

+45
-42
lines changed

1 file changed

+45
-42
lines changed

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

Lines changed: 45 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -225,27 +225,6 @@
225225
>
226226
<.icon name="tabler-user-dollar" class="h-6 w-6 shrink-0" />
227227
</.button>
228-
<.drawer
229-
show={@main_contract_form_open?}
230-
direction="right"
231-
on_cancel="close_main_contract_form"
232-
>
233-
<.drawer_header>
234-
<.drawer_title>Create new contract</.drawer_title>
235-
<.drawer_description>
236-
<div>Engage a developer for ongoing work</div>
237-
<div class="mt-2 flex items-center gap-1">
238-
<.icon name="tabler-bulb" class="h-5 w-5 shrink-0" />
239-
<span>
240-
Weekly contributions, PR review, internship, contract-to-hire
241-
</span>
242-
</div>
243-
</.drawer_description>
244-
</.drawer_header>
245-
<.drawer_content>
246-
<AlgoraWeb.Forms.ContractForm.contract_form form={main_contract_form} />
247-
</.drawer_content>
248-
</.drawer>
249228
</div>
250229
<% end %>
251230
<%= if main_bounty_form = Map.get(assigns, :main_bounty_form) do %>
@@ -260,27 +239,6 @@
260239
class="h-[0.8rem] w-[0.8rem] shrink-0 absolute bottom-[0.2rem] right-[0.2rem]"
261240
/>
262241
</.button>
263-
<.drawer
264-
show={@main_bounty_form_open?}
265-
direction="right"
266-
on_cancel="close_main_bounty_form"
267-
>
268-
<.drawer_header>
269-
<.drawer_title>Create new bounty</.drawer_title>
270-
<.drawer_description>
271-
<div>Create and fund a bounty for an issue</div>
272-
<div class="mt-2 flex items-center gap-1">
273-
<.icon name="tabler-bulb" class="h-5 w-5 shrink-0" />
274-
<span>
275-
New feature, integration, bug fix, CLI, mobile app, MCP, video
276-
</span>
277-
</div>
278-
</.drawer_description>
279-
</.drawer_header>
280-
<.drawer_content>
281-
<AlgoraWeb.Forms.BountyForm.bounty_form form={main_bounty_form} />
282-
</.drawer_content>
283-
</.drawer>
284242
</div>
285243
<% end %>
286244
<%!-- {live_render(@socket, AlgoraWeb.Activity.UserNavTimelineLive,
@@ -313,6 +271,51 @@
313271
</div>
314272
</div>
315273

274+
<%= if @current_user do %>
275+
<%= if main_contract_form = Map.get(assigns, :main_contract_form) do %>
276+
<.drawer
277+
show={@main_contract_form_open?}
278+
direction="right"
279+
on_cancel="close_main_contract_form"
280+
>
281+
<.drawer_header>
282+
<.drawer_title>Create new contract</.drawer_title>
283+
<.drawer_description>
284+
<div>Engage a developer for ongoing work</div>
285+
<div class="mt-2 flex items-center gap-1">
286+
<.icon name="tabler-bulb" class="h-5 w-5 shrink-0" />
287+
<span>
288+
Weekly contributions, PR review, internship, contract-to-hire
289+
</span>
290+
</div>
291+
</.drawer_description>
292+
</.drawer_header>
293+
<.drawer_content>
294+
<AlgoraWeb.Forms.ContractForm.contract_form form={main_contract_form} />
295+
</.drawer_content>
296+
</.drawer>
297+
<% end %>
298+
<%= if main_bounty_form = Map.get(assigns, :main_bounty_form) do %>
299+
<.drawer show={@main_bounty_form_open?} direction="right" on_cancel="close_main_bounty_form">
300+
<.drawer_header>
301+
<.drawer_title>Create new bounty</.drawer_title>
302+
<.drawer_description>
303+
<div>Create and fund a bounty for an issue</div>
304+
<div class="mt-2 flex items-center gap-1">
305+
<.icon name="tabler-bulb" class="h-5 w-5 shrink-0" />
306+
<span>
307+
New feature, integration, bug fix, CLI, mobile app, MCP, video
308+
</span>
309+
</div>
310+
</.drawer_description>
311+
</.drawer_header>
312+
<.drawer_content>
313+
<AlgoraWeb.Forms.BountyForm.bounty_form form={main_bounty_form} />
314+
</.drawer_content>
315+
</.drawer>
316+
<% end %>
317+
<% end %>
318+
316319
<div :if={!@current_user && !assigns[:screenshot?]} class="relative pt-16">
317320
<.flash_group flash={@flash} />
318321
<AlgoraWeb.Components.Header.header />

0 commit comments

Comments
 (0)