Skip to content

Commit e0986e5

Browse files
committed
refactor: improve layout and styling in BountyLive
- Adjusted padding in the scroll area for better spacing. - Simplified the structure of the bounty display by consolidating elements. - Enhanced button styling and layout for social share functionality. - Updated the social share button to use a more consistent design.
1 parent 4c8c520 commit e0986e5

File tree

1 file changed

+23
-19
lines changed

1 file changed

+23
-19
lines changed

lib/algora_web/live/bounty_live.ex

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -262,12 +262,12 @@ defmodule AlgoraWeb.BountyLive do
262262
def render(assigns) do
263263
~H"""
264264
<div class="flex">
265-
<.scroll_area class="h-[calc(100vh-64px)] flex-1 p-4">
265+
<.scroll_area class="h-[calc(100vh-64px)] flex-1 p-4 pr-6">
266266
<div class="space-y-4">
267267
<.card>
268268
<.card_content>
269269
<div class="flex justify-between">
270-
<div class="flex items-center gap-4">
270+
<div class="flex gap-4">
271271
<.avatar class="h-12 w-12 rounded-full">
272272
<.avatar_image src={@ticket.repository.user.avatar_url} />
273273
<.avatar_fallback>
@@ -287,18 +287,15 @@ defmodule AlgoraWeb.BountyLive do
287287
</div>
288288
</div>
289289
</div>
290-
<div class="font-display tabular-nums text-5xl text-success-400 font-bold">
291-
{Money.to_string!(@bounty.amount)}
290+
<div class="flex flex-col gap-4">
291+
<div class="font-display tabular-nums text-5xl text-success-400 font-bold">
292+
{Money.to_string!(@bounty.amount)}
293+
</div>
294+
<.button phx-click="reward">
295+
Reward
296+
</.button>
292297
</div>
293298
</div>
294-
<div class="pt-4 flex gap-2">
295-
<.button phx-click="reward">
296-
Reward
297-
</.button>
298-
<.button variant="secondary" phx-click="exclusive">
299-
<.icon name="tabler-lock" class="h-4 w-4 mr-2 -ml-1" /> Exclusive
300-
</.button>
301-
</div>
302299
</.card_content>
303300
</.card>
304301
<div class="grid grid-cols-2 gap-4">
@@ -308,6 +305,9 @@ defmodule AlgoraWeb.BountyLive do
308305
<.card_title>
309306
Exclusives
310307
</.card_title>
308+
<.button variant="secondary" phx-click="exclusive">
309+
<.icon name="tabler-user-plus" class="h-4 w-4 mr-2 -ml-1" /> Add
310+
</.button>
311311
</div>
312312
</.card_header>
313313
<.card_content>
@@ -336,7 +336,7 @@ defmodule AlgoraWeb.BountyLive do
336336
<.card_title>
337337
Share on socials
338338
</.card_title>
339-
<div class="flex gap-2">
339+
<div class="flex gap-3 items-center">
340340
<.social_share_button
341341
id="twitter-share-url"
342342
icon="tabler-brand-x"
@@ -629,10 +629,11 @@ defmodule AlgoraWeb.BountyLive do
629629

630630
defp social_share_button(assigns) do
631631
~H"""
632-
<div
632+
<.button
633633
id={@id}
634634
phx-hook="CopyToClipboard"
635635
data-value={@value}
636+
variant="secondary"
636637
phx-click={
637638
%JS{}
638639
|> JS.hide(
@@ -644,16 +645,19 @@ defmodule AlgoraWeb.BountyLive do
644645
transition: {"transition-opacity", "opacity-0", "opacity-100"}
645646
)
646647
}
647-
class="size-6 relative cursor-pointer mt-3 text-foreground/90 hover:text-foreground"
648-
variant="outline"
648+
class="size-8 relative cursor-pointer text-foreground/90 hover:text-foreground bg-muted"
649649
>
650-
<.icon id={@id <> "-copy-icon"} name={@icon} class="absolute my-auto size-6 mr-2" />
650+
<.icon
651+
id={@id <> "-copy-icon"}
652+
name={@icon}
653+
class="absolute inset-0 m-auto size-5 flex items-center justify-center"
654+
/>
651655
<.icon
652656
id={@id <> "-check-icon"}
653657
name="tabler-check"
654-
class="absolute my-auto hidden size-6 mr-2"
658+
class="absolute inset-0 m-auto hidden size-5 flex items-center justify-center"
655659
/>
656-
</div>
660+
</.button>
657661
"""
658662
end
659663

0 commit comments

Comments
 (0)