Skip to content

Commit ec36981

Browse files
committed
turn main create bounty form into plus button on sidebar
1 parent aa6f4f0 commit ec36981

File tree

1 file changed

+30
-19
lines changed

1 file changed

+30
-19
lines changed

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

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
</div>
7878

7979
<!-- Static sidebar for desktop -->
80-
<div class="scrollbar-thin hidden border-r border-border/50 lg:fixed lg:inset-y-0 lg:left-0 lg:z-50 lg:block lg:w-16 lg:overflow-y-auto lg:bg-popover lg:pb-4">
80+
<div class="scrollbar-thin hidden border-r border-border/50 lg:fixed lg:inset-y-0 lg:left-0 lg:z-50 lg:flex lg:flex-col lg:w-16 lg:overflow-y-auto lg:bg-popover lg:pb-4">
8181
<div class="flex h-16 shrink-0 items-center justify-center">
8282
<.logo class="h-8 w-auto text-white" />
8383
</div>
@@ -135,6 +135,35 @@
135135
</ul>
136136
<% end %>
137137
</nav>
138+
<%= if main_bounty_form = Map.get(assigns, :main_bounty_form) do %>
139+
<div class="mt-auto mx-auto">
140+
<.button
141+
phx-click="open_main_bounty_form"
142+
class="h-9 w-9 rounded-md flex items-center justify-center relative"
143+
>
144+
<.icon name="tabler-diamond" class="h-6 w-6 shrink-0" />
145+
<.icon
146+
name="tabler-plus"
147+
class="h-[0.8rem] w-[0.8rem] shrink-0 absolute bottom-[0.2rem] right-[0.2rem]"
148+
/>
149+
</.button>
150+
<.drawer
151+
show={@main_bounty_form_open?}
152+
direction="right"
153+
on_cancel="close_main_bounty_form"
154+
>
155+
<.drawer_header>
156+
<.drawer_title>Create new bounty</.drawer_title>
157+
<.drawer_description>
158+
Create and fund a bounty for an issue
159+
</.drawer_description>
160+
</.drawer_header>
161+
<.drawer_content class="mt-4">
162+
<AlgoraWeb.Forms.BountyForm.bounty_form form={main_bounty_form} />
163+
</.drawer_content>
164+
</.drawer>
165+
</div>
166+
<% end %>
138167
</div>
139168

140169
<div class="lg:pl-16">
@@ -189,24 +218,6 @@
189218
</.button>
190219
</ul>
191220
<% end %>
192-
<%= if main_bounty_form = Map.get(assigns, :main_bounty_form) do %>
193-
<.button phx-click="open_main_bounty_form">Create new bounty</.button>
194-
<.drawer
195-
show={@main_bounty_form_open?}
196-
direction="right"
197-
on_cancel="close_main_bounty_form"
198-
>
199-
<.drawer_header>
200-
<.drawer_title>Create new bounty</.drawer_title>
201-
<.drawer_description>
202-
Create and fund a bounty for an issue
203-
</.drawer_description>
204-
</.drawer_header>
205-
<.drawer_content class="mt-4">
206-
<AlgoraWeb.Forms.BountyForm.bounty_form form={main_bounty_form} />
207-
</.drawer_content>
208-
</.drawer>
209-
<% end %>
210221
<div class="ml-auto flex items-center gap-x-6">
211222
<.link
212223
class="group w-fit outline-none"

0 commit comments

Comments
 (0)