Skip to content

Commit dc1916d

Browse files
committed
updates
1 parent a4164f8 commit dc1916d

File tree

2 files changed

+66
-88
lines changed

2 files changed

+66
-88
lines changed

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

Lines changed: 54 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -135,64 +135,6 @@
135135
</ul>
136136
<% end %>
137137
</nav>
138-
<%= if main_contract_form = Map.get(assigns, :main_contract_form) do %>
139-
<div class="mt-auto mx-auto">
140-
<.button
141-
phx-click="open_main_contract_form"
142-
class="h-9 w-9 rounded-md flex items-center justify-center relative"
143-
>
144-
<.icon name="tabler-user-dollar" 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_contract_form_open?}
152-
direction="right"
153-
on_cancel="close_main_contract_form"
154-
>
155-
<.drawer_header>
156-
<.drawer_title>Create new contract</.drawer_title>
157-
<.drawer_description>
158-
Engage a developer for ongoing work
159-
</.drawer_description>
160-
</.drawer_header>
161-
<.drawer_content class="mt-4">
162-
<AlgoraWeb.Forms.ContractForm.contract_form form={main_contract_form} />
163-
</.drawer_content>
164-
</.drawer>
165-
</div>
166-
<% end %>
167-
<%= if main_bounty_form = Map.get(assigns, :main_bounty_form) do %>
168-
<div class="mt-auto mx-auto">
169-
<.button
170-
phx-click="open_main_bounty_form"
171-
class="h-9 w-9 rounded-md flex items-center justify-center relative"
172-
>
173-
<.icon name="tabler-diamond" class="h-6 w-6 shrink-0" />
174-
<.icon
175-
name="tabler-plus"
176-
class="h-[0.8rem] w-[0.8rem] shrink-0 absolute bottom-[0.2rem] right-[0.2rem]"
177-
/>
178-
</.button>
179-
<.drawer
180-
show={@main_bounty_form_open?}
181-
direction="right"
182-
on_cancel="close_main_bounty_form"
183-
>
184-
<.drawer_header>
185-
<.drawer_title>Create new bounty</.drawer_title>
186-
<.drawer_description>
187-
Create and fund a bounty for an issue
188-
</.drawer_description>
189-
</.drawer_header>
190-
<.drawer_content class="mt-4">
191-
<AlgoraWeb.Forms.BountyForm.bounty_form form={main_bounty_form} />
192-
</.drawer_content>
193-
</.drawer>
194-
</div>
195-
<% end %>
196138
</div>
197139

198140
<div class="lg:pl-16">
@@ -266,26 +208,60 @@
266208
</div>
267209
</.link>
268210
<%= if @current_user do %>
269-
<.button
270-
phx-click="open_main_contract_form"
271-
class="h-9 w-9 rounded-md flex items-center justify-center relative"
272-
>
273-
<.icon name="tabler-user-dollar" class="h-6 w-6 shrink-0" />
274-
<%!-- <.icon
275-
name="tabler-plus"
276-
class="h-[0.8rem] w-[0.8rem] shrink-0 absolute bottom-[0.2rem] right-[0.2rem]"
277-
/> --%>
278-
</.button>
279-
<.button
280-
phx-click="open_main_bounty_form"
281-
class="h-9 w-9 rounded-md flex items-center justify-center relative"
282-
>
283-
<.icon name="tabler-diamond" class="h-6 w-6 shrink-0" />
284-
<.icon
285-
name="tabler-plus"
286-
class="h-[0.8rem] w-[0.8rem] shrink-0 absolute bottom-[0.2rem] right-[0.2rem]"
287-
/>
288-
</.button>
211+
<%= if main_contract_form = Map.get(assigns, :main_contract_form) do %>
212+
<div>
213+
<.button
214+
phx-click="open_main_contract_form"
215+
class="h-9 w-9 rounded-md flex items-center justify-center relative"
216+
>
217+
<.icon name="tabler-user-dollar" class="h-6 w-6 shrink-0" />
218+
</.button>
219+
<.drawer
220+
show={@main_contract_form_open?}
221+
direction="right"
222+
on_cancel="close_main_contract_form"
223+
>
224+
<.drawer_header>
225+
<.drawer_title>Create new contract</.drawer_title>
226+
<.drawer_description>
227+
Engage a developer for ongoing work
228+
</.drawer_description>
229+
</.drawer_header>
230+
<.drawer_content class="mt-4">
231+
<AlgoraWeb.Forms.ContractForm.contract_form form={main_contract_form} />
232+
</.drawer_content>
233+
</.drawer>
234+
</div>
235+
<% end %>
236+
<%= if main_bounty_form = Map.get(assigns, :main_bounty_form) do %>
237+
<div>
238+
<.button
239+
phx-click="open_main_bounty_form"
240+
class="h-9 w-9 rounded-md flex items-center justify-center relative"
241+
>
242+
<.icon name="tabler-diamond" class="h-6 w-6 shrink-0" />
243+
<.icon
244+
name="tabler-plus"
245+
class="h-[0.8rem] w-[0.8rem] shrink-0 absolute bottom-[0.2rem] right-[0.2rem]"
246+
/>
247+
</.button>
248+
<.drawer
249+
show={@main_bounty_form_open?}
250+
direction="right"
251+
on_cancel="close_main_bounty_form"
252+
>
253+
<.drawer_header>
254+
<.drawer_title>Create new bounty</.drawer_title>
255+
<.drawer_description>
256+
Create and fund a bounty for an issue
257+
</.drawer_description>
258+
</.drawer_header>
259+
<.drawer_content class="mt-4">
260+
<AlgoraWeb.Forms.BountyForm.bounty_form form={main_bounty_form} />
261+
</.drawer_content>
262+
</.drawer>
263+
</div>
264+
<% end %>
289265
<%!-- {live_render(@socket, AlgoraWeb.Activity.UserNavTimelineLive,
290266
id: "activity-timeline",
291267
session: %{},

lib/algora_web/forms/contract_form.ex

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ defmodule AlgoraWeb.Forms.ContractForm do
4949
phx-change="validate_contract_main"
5050
>
5151
<div class="space-y-4">
52+
<.input label="Title" field={@form[:title]} />
53+
<.input label="Description (optional)" field={@form[:description]} type="textarea" />
54+
<label class="block text-sm font-semibold leading-6 text-foreground mb-2">
55+
Payment
56+
</label>
5257
<div class="grid grid-cols-2 gap-4" phx-update="ignore" id="main-contract-form-tabs">
5358
<%= for {label, value} <- type_options() do %>
5459
<label class={[
@@ -80,17 +85,14 @@ defmodule AlgoraWeb.Forms.ContractForm do
8085
<% end %>
8186
</div>
8287
83-
<.input label="Title" field={@form[:title]} placeholder="Brief description of the contract" />
84-
<.input
85-
label="Description (optional)"
86-
field={@form[:description]}
87-
type="textarea"
88-
placeholder="Requirements and acceptance criteria"
89-
/>
90-
<.input label="Amount" icon="tabler-currency-dollar" field={@form[:amount]} />
91-
88+
<div data-tab="fixed">
89+
<.input label="Amount" icon="tabler-currency-dollar" field={@form[:amount]} />
90+
</div>
9291
<div data-tab="hourly" class="hidden">
93-
<.input label="Hours per week" field={@form[:hours_per_week]} />
92+
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
93+
<.input label="Hourly rate" icon="tabler-currency-dollar" field={@form[:amount]} />
94+
<.input label="Hours per week" field={@form[:hours_per_week]} />
95+
</div>
9496
</div>
9597
9698
<div class="relative">

0 commit comments

Comments
 (0)